You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.
In order to better control the behaviour of the logs and be able for example to send everything that was logged on Error level to Sentry, we need a library that supports log levels.
The obvious choice would be Logrus because we already have ready to use hooks in our internal libraries and it's one of the most used logging library in the Go community.
The text was updated successfully, but these errors were encountered:
I'd strongly prefer using an interface rather than a tight binding - there are other compatible loggers (like apex/log) that provide different feature sets. Logrus compatibility is desirable, a hard binding to it less so.
My concern with an interface is that it limits the possibilities and requires too much work.
Logrus, Apex, Zerolog etc. use method chaining for building a single log line. Adding an interface to deal with that means in fact adding multiple big interfaces that will be painful to implement.
IMO customizing a logger means being able to:
select the log level
select the output (io.Writer)
add hooks
Also, it must output JSON.
We could simply select any logger that is capable of doing so and use it as is, I don't think it would handicap users in any way as long as they can customize the points above.
I'm just afraid that abstracting the logger would make us write something too big.
In order to better control the behaviour of the logs and be able for example to send everything that was logged on Error level to Sentry, we need a library that supports log levels.
The obvious choice would be Logrus because we already have ready to use hooks in our internal libraries and it's one of the most used logging library in the Go community.
The text was updated successfully, but these errors were encountered: