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

Added OnLevel method to allow for configurable log level #4

Closed
wants to merge 2 commits into from

Conversation

dahankzter
Copy link

I do this in a custom middleware I have in my project but I thought why not use your published version. I do need to be able to switch levels however so did this.

What do you think?

@dahankzter
Copy link
Author

Ping @appleboy would this be of interest?

@appleboy
Copy link
Member

how to change log level?

@dahankzter
Copy link
Author

Zap has an atomic level zapcore.AtomicLevel that can be changed runtime safely.

If you give the constructor in this patch a given level say DebugLevel it will only log on that level and combined with the AtomicLogger you can switch on and off that behaviour.

As for how you signal the app is up to the application creator. I often use a Nats channel or a Zeromq to broadcast changes like these but you could do whatever suits you I guess.

@dahankzter
Copy link
Author

If you want to I can provide an example in the example directory as well.

@dahankzter
Copy link
Author

I hope the example isn't too messy @appleboy does this work?

@dahankzter
Copy link
Author

I really don't know why the check failed.

@dahankzter
Copy link
Author

I have no idea what the check that fails mean:

The command "embedmd -d *.md" exited with 2.

@appleboy
Copy link
Member

appleboy commented Aug 4, 2017

@dahankzter because you change the example code, please also update the readme.

see more detail about embedmd tool github.com/campoy/embedmd

@appleboy
Copy link
Member

appleboy commented Dec 6, 2018

conflicts.

@appleboy
Copy link
Member

fixed in #53

@appleboy appleboy closed this Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants