raystack / salt

Salt is a collection of libraries and tools used in the Raystack ecosystem to improve the experience of developing projects with Go.
Apache License 2.0
13 stars 8 forks source link

unified logging pattern & facilities #53

Open spy16 opened 2 years ago

spy16 commented 2 years ago

Currently salt/log package tries to abstract Logrus and Zap into a common formatted-logger interface (i.e., Infof(msg string, args ...any), etc. ). While logrus is designed as a formatted-logger, uber/zap is specifically designed for efficient structured logging and this kind of abstraction nullifies the major benefit of it.

I propose we remove this abstraction altogether[^1] and assume direct usage of zap within salt and in ODPF applications that use salt. Benefits of doing this:

[^1]: We can still have some utility functions if we need to (e.g., a helper to inject log context into ctx). But attempting to abstract over logging functionality will not have justifiable benefits.

krtkvrm commented 1 year ago

+1, we can just have helpers over uber/zap