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

Support for debug() under Printer? #15

Open
narayanacharya6 opened this issue May 23, 2021 · 0 comments
Open

Support for debug() under Printer? #15

narayanacharya6 opened this issue May 23, 2021 · 0 comments

Comments

@narayanacharya6
Copy link

Currently if I wish to print debug messages, the usage is something like this:

from wasabi import msg
msg.info('Hello', show=is_verbose)

But now is_verbose is scattered everywhere in code. I'd like to propose a class-level variable for Printer that sets the is_verbose flag once with the Printer and a msg.debug() function that will print based on this flag. Essentially a flag for log level is what I am looking for.

Proposed Usage:

from wasabi import Printer
msg = Printer(is_verbose=True)
msg.debug('Hello') # This prints to console
msg = Printer(is_verbose=False)
msg.debug('Hello') # This does not print to console

Let me know if this usage makes sense and I can contribute a PR or maybe there is an existing way to achieve this functionality that I am probably now aware of? :)

@narayanacharya6 narayanacharya6 changed the title Support for msg.debug under Printer? Support for debug() under Printer? May 23, 2021
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