minilog
raw JSON → 2.3.1 verified Mon Apr 27 auth: no python
Minimalistic wrapper for Python's standard logging module. Provides a simpler API with sensible defaults. Current version 2.3.1, released under MIT license. Maintained regularly.
pip install minilog Common errors
error AttributeError: module 'minilog' has no attribute 'Logger' ↓
cause Installed old version (v1.x) where Logger was not exported at package level.
fix
Upgrade to v2: pip install --upgrade minilog. Or use from minilog.logger import Logger for v1.
error ImportError: cannot import name 'Logger' from 'minilog' ↓
cause Typo or using outdated import path.
fix
Use: from minilog import Logger
error TypeError: Logger() takes 0 positional arguments but 1 was given ↓
cause Trying to pass name as positional argument in v2.3+ where signature changed.
fix
Use Logger(__name__) is still valid but in some v2 versions only keyword works. Check docs.
Warnings
breaking In v2.0, the API changed: Logger() now requires no arguments by default; positional argument for name is optional. ↓
fix Use Logger(__name__) if you want module-specific logger, or Logger() for root.
deprecated The `log_level` argument in Logger constructor (used in v1.x) is ignored in v2. Use `setLevel()` instead. ↓
fix Call log.setLevel('DEBUG') after creation.
gotcha Logger by default uses stdout, not stderr. Many expect logging to go to stderr. ↓
fix Configure handler: log.handler.stream = sys.stderr
gotcha The library is not thread-safe by default. Use logging locks if needed. ↓
fix Wrap with threading.Lock when logging from multiple threads.
Imports
- Logger wrong
from minilog.logger import Loggercorrectfrom minilog import Logger
Quickstart
from minilog import Logger
log = Logger() # or Logger(__name__) for module-specific
log.debug('This is debug')