You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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? :)
The text was updated successfully, but these errors were encountered:
narayanacharya6
changed the title
Support for msg.debug under Printer?
Support for debug() under Printer?
May 23, 2021
Currently if I wish to print debug messages, the usage is something like this:
But now
is_verbose
is scattered everywhere in code. I'd like to propose a class-level variable forPrinter
that sets theis_verbose
flag once with thePrinter
and amsg.debug()
function that will print based on this flag. Essentially a flag for log level is what I am looking for.Proposed Usage:
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? :)
The text was updated successfully, but these errors were encountered: