top | item 17609582

(no title)

notheguyouthink | 7 years ago

For me, the biggest thing in logging these days is being able to remove performance impact of logs lower than the level threshold. How does this library compare?

Currently I'm using Zerolog, which has a nice compromise of UX, performance and adoption. The less cost the better if my application logs with a level that is not enabled.

discuss

order

z0mbie42|7 years ago

Hi, thank you for the feedback.

For the moment, it stands between logrus and zerolog/zap in term of speed/allocation.

For a message with 10 fields, zerolog does 6 allocs, astroflow 13 and logrus 54, but the UX is far better than zerolog (IMO).

OTH there is no cost (only 1 if comparison) if the level is not enabled.

In a near future the same mechanism as in zeolog will be implemented which enable to reduce allocations in tradeoff of writing more verbose code.