The Notifiers Module¶
The notifiers module implements special handlers for various platforms that depend on external libraries. The more module implements special handlers and other things that are beyond the scope of Logbook itself or depend on external libraries.
- logbook.notifiers.create_notification_handler(application_name=None, level=0, icon=None)[source]¶
Creates a handler perfectly fit the current platform. On Linux systems this creates a
LibNotifyHandler
, on OS X systems it will create aGrowlHandler
.
OSX Specific Handlers¶
- class logbook.notifiers.GrowlHandler(application_name=None, icon=None, host=None, password=None, record_limit=None, record_delta=None, level=0, filter=None, bubble=False)[source]¶
A handler that dispatches to Growl. Requires that either growl-py or py-Growl are installed.
- emit(record)[source]¶
Emit the specified logging record. This should take the record and deliver it to whereever the handler sends formatted log records.
Linux Specific Handlers¶
- class logbook.notifiers.LibNotifyHandler(application_name=None, icon=None, no_init=False, record_limit=None, record_delta=None, level=0, filter=None, bubble=False)[source]¶
A handler that dispatches to libnotify. Requires pynotify installed. If no_init is set to True the initialization of libnotify is skipped.
- emit(record)[source]¶
Emit the specified logging record. This should take the record and deliver it to whereever the handler sends formatted log records.
- get_expires(record)[source]¶
Returns either EXPIRES_DEFAULT or EXPIRES_NEVER for this record. The default implementation marks errors and criticals as EXPIRES_NEVER.
Other Services¶
- class logbook.notifiers.BoxcarHandler(email, password, record_limit=None, record_delta=None, level=0, filter=None, bubble=False)[source]¶
Sends notifications to boxcar.io. Can be forwarded to your iPhone or other compatible device.
- class logbook.notifiers.NotifoHandler(application_name=None, username=None, secret=None, record_limit=None, record_delta=None, level=0, filter=None, bubble=False, hide_level=False)[source]¶
Sends notifications to notifo.com. Can be forwarded to your Desktop, iPhone, or other compatible device.
- class logbook.notifiers.PushoverHandler(application_name=None, apikey=None, userkey=None, device=None, priority=0, sound=None, record_limit=None, record_delta=None, level=0, filter=None, bubble=False, max_title_len=100, max_message_len=512)[source]¶
Sends notifications to pushover.net. Can be forwarded to your Desktop, iPhone, or other compatible device. If priority is not one of -2, -1, 0, or 1, it is set to 0 automatically.