NAME

Ereshkigal::LogDrek - Exportable syslog helper shared by the Ereshkigal bins and modules.

VERSION

Version 0.0.1

SYNOPSIS

use Ereshkigal::LogDrek qw( log_drek );

log_drek( 'info', 'started' );
log_drek( 'err',  'something broke', $tracking_int );
log_drek( 'info', 'banned 1.2.3.4', undef, 'kur-sshd' );

DESCRIPTION

This holds the log_drek sub used by both ereshkigal and kur as well as the various Ereshkigal modules for logging everything they do. It is a plain function usable without new or the like being called, exported on request, so everything can share one implementation instead of each carrying their own copy.

EXPORTS

Nothing is exported by default. "log_drek" is available via @EXPORT_OK.

FUNCTIONS

log_drek

Writes a message to syslog.

log_drek( $level, $message, $tracking_int, $ident );

$level defaults to 'info' when undef or not a valid syslog level. When $tracking_int is defined it is prepended to the message as $tracking_int . ' : ' . $message. $ident is the syslog ident to log under and defaults to 'ereshkigal' when undef. Kur instances should pass 'kur-' . $name so log lines are attributable per instance.

Logging failures are swallowed rather than propagated, with a best effort print to STDERR instead, so logging can never take down the caller.