Skip to content
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

Return logger name #1200

Closed
djarbz opened this issue Nov 12, 2022 · 4 comments
Closed

Return logger name #1200

djarbz opened this issue Nov 12, 2022 · 4 comments

Comments

@djarbz
Copy link

djarbz commented Nov 12, 2022

Is your feature request related to a problem? Please describe.
I am writing an application that overall should have a user specified log level, ie INFO.
But they can overwrite the log level for certain "actions" that would be handled on a case by case basis.
Since we are unable to change the log level of a cloned logger, I am instantiating a new logger set to the DEBUG level.
Currently, this new logger does not have the inherited name for the existing logger.
I would like a function such as zapLog.GetName() that would return a string of the current log name that I can then pass on to the new logger.

Is this a breaking change?
I do not believe this would be a breaking change as it would add a function to the current interface.

@prashantv
Copy link
Collaborator

It seems reasonable to add Name() string to *Logger that exposes the name.

@rexywork
Copy link
Contributor

Hi, I try to create PR for this issues here:
#1273

Please check the comment so I can double check what I need to do

@rnemeth90
Copy link

Is this being actively worked on? If not, please assign to me and I'll submit a PR.

@prashantv
Copy link
Collaborator

This was released in https://github.com/uber-go/zap/releases/tag/v1.25.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants