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
There is no documentation for how plugin authors should make use of python logging in order to integrate nicely with tox own logging. The use of standard python logging is great but there are some tox specific details that might confuse plugin authors.
Once I get the behavior identified and a good example, I will make a PR to add this to the documentation and close this ticket.
Minimal example
# plugin codeimportlogging# you could use getLogger and have your own instance but it does not# have any apparent visible changes.# should produce a line visible only when using -v or morelogging.info("%s%s> %s", "", __package__, "this is a message")
# should produce a warning line, potentially using the cyan prefix colorer if msg is ``%s%s> %s`logging.warning("%s%s> %s", "", __package__, "this is a message")
# produce an error, colored in red if ansi enabled but withoutlogging.error("%s%s> %s", "", __package__, "this is a message")
Identified challenges:
logging level is not visible in output, only the coloring determines it (potential accessibility issue)
info level is not displayed by default
warning level is using a normal color, not yellow/orange. If you want to make some output on default logging you are forced to use warning, even if what you mean is probably a "notice"
unable to colorize "error" lines (cyan prefix works only for warning)
if you want to include plugin name, you have to use something like below:
logging.warning("%s%s> %s", "", __package__, f"This is a message from {__package__} plugin")
logging.error("%s%s> %s", "", __package__, f"This is a message from {__package__} plugin")
# ^ this is possible only for warning, if you try to log error, you cannot colorize the plugin name as the entire line will be re
The text was updated successfully, but these errors were encountered:
Issue
There is no documentation for how plugin authors should make use of python logging in order to integrate nicely with tox own logging. The use of standard python logging is great but there are some tox specific details that might confuse plugin authors.
Once I get the behavior identified and a good example, I will make a PR to add this to the documentation and close this ticket.
Minimal example
Identified challenges:
The text was updated successfully, but these errors were encountered: