-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
slog: structured logging #1
Conversation
So that it does not clash with the standard lib's slog package.
Reuse some of the slog.Level types and add a few of our own. Also, move level logic to its own file for readability.
And let subLog implement the methods by calling its existing methods. Note that subLog will not produce structured logs as of this commit. In future, it can be updated to use an slog.Logger and this package can implement a default slog.Handler.
Update the buffer pool to use a concrete type and steel some other updates from the buffer pool used by std lib. Also adds a few useful helpers that we will use later on and also factors out the timestamp writing part from formatHeader since we will use that again later.
Since we will use it later no with a different skip depth.
30a57a4
to
b060cde
Compare
Which is a valid Handler that can be used with the NewSloggger call.
cc @yyforyongyu - This is the same as the PR in btclog but just with the module name updated & the travis file removed. I'll open a follow up that adds basic CI for unit tests and that removes the old logger implementation which will address Oli's comment in the other PR. The reason im splitting this into this and a follow up is:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gogogo🎉
closing in favour of a v2 module in the upstream repo |
See the OG PR here: btcsuite#17
all the initial commits are the same. Only addition is the last few commits that just removes the old logger impl & runs unit tests in GH. Also basic Readme updates.