Repository navigation
Logger / Helper
#2282
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Just couple thoughts about logger/helper. Want to hear your thoughts.
Logger extension
Logger interface could have WithCallerSkipCount method to return a new Logger (similar to Fields method). This way we could rebuild logger in NewHandler constructor with +1 skip.
DefaultLogger extension
It looks like common pattern of micro logger's usage is to call logger.Info / logger.Error, etc. So maybe interface type of DefaultLogger should also respect that and have Info/Error methods? I mean Helper-like interface. Or it can be of type Helper?
Helper + Logger
Do we need Helper apart from Logger actually? Wouldn't it be clearer to add methods from Helper to interface and implementations?
All reactions