Skip to content

Commit

Permalink
Use the logging module directly instead of home-grown code.
Browse files Browse the repository at this point in the history
This has the advantage of overall less custom code; as well as support
for per-module configuration. This would enable a potential solution for
ultrabug#1479, since in the future
it can allow per-module configuration of log levels.

I expect this to mainly help module creators, allowing them to enable
logging for only their module, while disabling all other messages. It
also is easier to use, since the `logging` module's interface is
generally simpler than `self.py3`.

Here, I've made the decision to keep the message format as close as
possible to the existing log messages.
  • Loading branch information
rlerm committed Jan 31, 2022
1 parent 37bc19e commit ae4ccbc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions py3status/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
"info": logging.INFO,
}

LOGGING_LEVELS = {
"error": logging.ERROR,
"warning": logging.WARNING,
"info": logging.INFO,
}

DBUS_LEVELS = {"error": "critical", "warning": "normal", "info": "low"}

CONFIG_SPECIAL_SECTIONS = [
Expand Down

0 comments on commit ae4ccbc

Please sign in to comment.