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

If log.SetPrefix() contains square brackets it breaks filtering. #8

Open
TheMightyGit opened this issue Dec 7, 2020 · 1 comment
Open

Comments

@TheMightyGit
Copy link

TheMightyGit commented Dec 7, 2020

log.SetPrefix("[ this will break your filtering ]")

My existing code added some extra data using SetPrefix which included square brackets. When I added logutils I noticed that it was not filtering out any log messages (I got them all regardless of their level). I changed from square to normal brackets in my SetPrefix call and it fixed it.

I don't know if you need to fix this in logutils as such, but it may be worth noting it in the docs to help others avoid having this enigmatic problem.

@TheMightyGit
Copy link
Author

Playground repro - https://play.golang.org/p/A36wvUQ5K7Z

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

No branches or pull requests

1 participant