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

Not an issue, just a question regarding limiting verbosity #1447

Open
neilyoung opened this issue Nov 26, 2024 · 2 comments
Open

Not an issue, just a question regarding limiting verbosity #1447

neilyoung opened this issue Nov 26, 2024 · 2 comments
Labels

Comments

@neilyoung
Copy link

I really like your module and use it a lot in my apps. Usually I'm doing very verbose logging, also in order to simplify my life as developer later on in operation.

But sometimes it is not feasible to "tell everything to everyone". I think I know how to suppress all log outputs, but I'm currently looking for an elegant way to make them disappear at all (even from binary as texts), in case I'm setting a special environment variable at build time.

My attempts to replace your module by dummies failed so far and I don't want to mess up all my code with constructs like this:

if debug {
  log.Info("...")
}

Would you know an elegant but efficient way to achieve this? Silencing all logging, removing all log strings with a snip or trick?

@neilyoung
Copy link
Author

Found it. After having messed with my own pre-processor, which went through all the go files and "sed" all the log entries out I found this neat project, which is pretty much of help here: https://github.com/pijng/go-ifdef

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant