Logbook is a logging system for Python that replaces the standard library’s logging module.
How to install #
$ pip install logbook
$ python >>> from logbook import Logger, StreamHandler >>> import sys >>> StreamHandler(sys.stdout).push_application() >>> log = Logger('My Awesome Logger') >>> log.warn('This is too cool for stdlib') [2015-10-05 19:02:03.575723] WARNING: My Awesome Logger: This is too cool for stdlib
Core Features #
- Based on the concept of loggers
- Has extendable built-in handlers
- Handlers can be set on an application-wide stack as well as a thread-wide stack
- Has built-in handlers for streams, arbitrary files, files with time and size based rotation
- Possibility to inject a handler for testing that records messages for assertions.
- Built-in support for ZeroMQ, RabbitMQ, Redis
- Different log levels