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 a GrowlHandler.

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.

get_priority(record)[source]

Returns the priority flag for Growl. Errors and criticals are get highest priority (2), warnings get higher priority (1) and the rest gets 0. Growl allows values between -2 and 2.

is_sticky(record)[source]

Returns True if the sticky flag should be set for this record. The default implementation marks errors and criticals sticky.

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.

get_urgency(record)[source]

Returns the urgency flag for pynotify. Errors and criticals are get highest urgency (CRITICAL), warnings get higher priority (NORMAL) and the rest gets LOW.

set_notifier_icon(notifier, icon)[source]

Used to attach an icon on a notifier object.

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.

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_screen_name(record)[source]

Returns the value of the screen name field.

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.

emit(record)[source]

Emit the specified logging record. This should take the record and deliver it to whereever the handler sends formatted log records.

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.

emit(record)[source]

Emit the specified logging record. This should take the record and deliver it to whereever the handler sends formatted log records.

Base Interface

class logbook.notifiers.NotificationBaseHandler(application_name=None, record_limit=None, record_delta=None, level=0, filter=None, bubble=False)[source]

Baseclass for notification handlers.

make_text(record)[source]

Called to get the text of the record.

make_title(record)[source]

Called to get the title from the record.