Adam Stacoviak changelog.com/posts

Logbook: Impressive Logging for Python

Python’s logging module from the standard libarary has over stayed its welcome for far too long.

Armin Ronacher, the creator of Sphinx, Flask, and Pygments just released a much needed module to the Python community: Logbook.

Logbook is an extremely well documented and powerful logging handler library. Out of the box, it includes log handlers for Standard Logfiles, Email, Syslog, NTEventLog, and Custom Notifiers. It even supports Growl and LibNotify integration.

Basic usage:

>>> from logbook import Logger
>>> log = Logger('Logbook')
>>> log.info('Hello, World!')
[2010-07-23 16:34] INFO: Logbook: Hello, World!

Growl Integration:

import logbook.notifiers
from logbook import Logger

logger = Logger('Haystack')
handler = logbook.notifiers.create_notification_handler()

with handler:
    logger.warn('This is a notification!')

[Project Page] [Source on GitHub] [DjangoCon Presentation]


Discussion

Sign in or Join to comment or subscribe

Player art
  0:00 / 0:00