Closed MisLink closed 2 years ago
Could you add a simple test?
Although almost tests of this lib does not check/ensure the test result is correct, but have a test is better, because we could run it by "go test -v" then check result by our eyes. :D
thanks, let me check this pr locally then merge it if no issues this night.
Reverted, need find way to avoid performance hit.
see https://github.com/phuslu/log/runs/6489242631?check_suite_focus=true
Now "BenchmarkDisablePhusLog" is slower than zerolog if have this PR.
unroll slient()
in https://github.com/phuslu/log/commit/0f4ff05606ba48b99647dc836b1e7e4c66557585 cannot avoid performance hit.
https://github.com/phuslu/log/runs/6489809266?check_suite_focus=true
Well, zerolog doesn't support to change level for a logger. It can only call Level(lvl)
to create a new logger with lvl
. Because of it, zerolog can avoid one atomic call. It seems there is not much to improve it.
create a new logger
the "create a new logger" is expensive in critical(hot) path of high QPS server, that's why I choose atomic call(an in-place operation) to do this.
close #52