All Versions
7
Latest Version
Avg Release Cycle
-
Latest Release
646 days ago

Changelog History

  • v1.5.0

    March 07, 2018
    • logzero.syslog(..) (PR 83 <https://github.com/metachris/logzero/pull/84>_)
  • v1.4.0

    March 02, 2018
    • 👍 Allow Disabling stderr Output (PR 83 <https://github.com/metachris/logzero/pull/83>_)
  • v1.3.0

    July 19, 2017
    • 🏁 Color output now works in Windows (supported by colorama)
  • v1.2.1

    July 09, 2017
    • Logfiles with custom loglevels (eg. stream handler with DEBUG and file handler with ERROR).
  • v1.2.0

    July 05, 2017
    • 🔧 Way better API for configuring the default logger with logzero.loglevel(..), logzero.logfile(..), etc.
    • 🌲 Built-in rotating logfile support.

    .. code-block:: python

    import logging
    import logzero
    from logzero import logger
    
    # This log message goes to the console
    logger.debug("hello")
    
    # Set a minimum log level
    logzero.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 file
    logzero.logfile(None)
    
    # Set a custom formatter
    formatter = logging.Formatter('%(name)s - %(asctime)-15s - %(levelname)s: %(message)s');
    logzero.formatter(formatter)
    
    # Log some variables
    logger.info("var1: %s, var2: %s", var1, var2)
    
  • v1.1.2

    July 04, 2017
    • 👍 Better reconfiguration of handlers, doesn't remove custom handlers anymore
  • v1.1.0

    July 03, 2017
    • 🛠 Bugfix: Disabled color logging to logfile