Closed rfyiamcool closed 1 year ago
Thanks, almost LGTM but I think BoolRaw is a bit confusing, Could we name it with a more appropriate one? E.g. RawBool, Boolean, BoolString, which one is your prefer or please give your advice.
Moreover, I suggest use b = append(b, 't', 'r', 'u', 'e', e.sep)
to reduce cycles.
refer to https://godbolt.org/z/W5a5ovK5E
@phuslu done. 😁
func TestTSVLogger(t *testing.T) {
logger := TSVLogger{}
logger.New().
Timestamp().
TimestampMS().
Caller(1).
Bool(true).
Bool(false).
BoolString(true).
BoolString(false).
Msg()
}
Running tool: /usr/local/go/bin/go test -timeout 120s -run ^TestTSVLogger$ github.com/phuslu/log -v -count=1
=== RUN TestTSVLogger
1683118198 1683118198173 tsv_test.go:15 1 0 true false
Moreover, I suggest use
b = append(b, 't', 'r', 'u', 'e', e.sep)
to reduce cycles. refer to https://godbolt.org/z/W5a5ovK5E
👍
thanks, merged and tagged v1.0.86
why
Add
BoolRaw()
method in tsv.go. Use theBoolRaw
method to output a true or false string. Or I directly changed theBool()
method, output bool's string, such as true, false ???test result
test code
output: