otter
otter copied to clipboard
Expose newDefaultLogger function
Description
We may want to use the default logger with a custom slog.Logger, for example, add custom attributes or format.
Copying the default logger's code is redundant in those use cases.
Related issue(s)
None
:white_check_mark: Checklist for your Pull Request
Related changes (conditional)
-
Tests
- [x] If I added new functionality, I added tests covering it.
- [ ] If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
-
Documentation
- [x] I checked whether I should update the docs and did so if necessary:
- README
- [x] I checked whether I should update the docs and did so if necessary:
-
Public contracts
- [x] My changes doesn't break project license.
Stylistic guide (mandatory)
- [x] My code complies with the styles guide.
Before merging (mandatory)
- [x] Check target branch of PR is set correctly
Hi, sorry for the delayed reply, I've been extremely busy this past week.
It looks good, but I don't like the name NewDefaultLogger. It seems more like just a wrapper over the slog logger. Usually, this is done through something like a plugin system, at the very least, users of zap and zerolog might want the same thing. For example, franz-go.
I'll take a closer look on Saturday.