logger

raw JSON →
1.4 verified Mon Apr 27 auth: no python maintenance

A simple Python logging helper providing easy setup for logging to console and files with color support. It wraps Python's standard library logging module. Current version: 1.4. Release cadence: infrequent, last updated in 2017.

pip install logger
error ImportError: No module named 'logger'
cause The package is named 'logger' and must be installed, but there is also a standard library 'logging' module which is different.
fix
Install the package: pip install logger
error AttributeError: module 'logging' has no attribute 'get_logger'
cause Confusion between the 'logger' package and the built-in 'logging' module.
fix
Use 'import logger' instead of 'import logging'.
deprecated The logger package has not been updated since 2017 and relies on older Python versions (2.7/3.4). May not be compatible with newer Python 3.12+.
fix Consider using Python's built-in logging module or a more modern alternative like 'loguru'.
gotcha The 'logger.get_logger()' function returns a Python logging.Logger instance, not a custom class. It does not add any methods beyond standard logging.
fix Use standard logging.Logger methods: .info(), .debug(), etc.

Creates a simple logger and logs an info message.

import logger
log = logger.get_logger('myapp')
log.info('Application started')