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

Does a package exist to use icecream with logging? #146

Open
GeorgePearse opened this issue May 11, 2023 · 2 comments
Open

Does a package exist to use icecream with logging? #146

GeorgePearse opened this issue May 11, 2023 · 2 comments

Comments

@GeorgePearse
Copy link

I love icecream, but want to leave it in useful positions in my code for debugging, for code that goes into production.

I'd want to use it with the logging module (and prevent those statements from outputting content by setting the logging level).

@GeorgePearse GeorgePearse changed the title Does a package exist to use icecream with logging Does a package exist to use icecream with logging? May 11, 2023
@Dave-DigiMim
Copy link

So how about a debug=True prints message and debug=False does not?

@ranelpadon
Copy link

@GeorgePearse I use ic with the logging module like this:

foo = 'bar'
logger.debug(ic.format(foo))

since ic.format() will pass the string output to the logger instead of printing it.

So, this could be easily controlled by the log level.

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

3 participants