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
{{ message }}
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.
Color output now works in Windows (supported by colorama)
1.2.1 (2017-07-09)
Logfiles with custom loglevels (eg. stream handler with DEBUG and
file handler with ERROR).
1.2.0 (2017-07-05)
Way better API for configuring the default logger with logzero.loglevel(..), logzero.logfile(..), etc.
Built-in rotating logfile support.
importloggingimportlogzerofromlogzeroimportlogger# This log message goes to the consolelogger.debug("hello")
# Set a minimum log levellogzero.loglevel(logging.INFO)
# Set a logfile (all future log messages are also saved there)logzero.logfile("/tmp/logfile.log")
# Set a rotating logfile (replaces the previous logfile handler)logzero.logfile("/tmp/rotating-logfile.log", maxBytes=1000000, backupCount=3)
# Disable logging to a filelogzero.logfile(None)
# Set a custom formatterformatter=logging.Formatter('%(name)s - %(asctime)-15s - %(levelname)s: %(message)s');
logzero.formatter(formatter)
# Log some variableslogger.info("var1: %s, var2: %s", var1, var2)
1.1.2 (2017-07-04)
Better reconfiguration of handlers, doesn't remove custom handlers
anymore
1.1.0 (2017-07-03)
Bugfix: Disabled color logging to logfile
1.1.0 (2017-07-02)
Global default logger instance (logzero.logger)
Ability to reconfigure the default logger with (logzero.setup_default_logger(..))