The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

App::CELL::Log - the Logging part of CELL

VERSION

Version 0.088

SYNOPSIS

    use App::CELL::Log qw( log_debug log_info );

    # configure logging for application FooBar -- need only be done once
    my $status = App::CELL::Log::configure('FooBar');  
    return $status unless $status->ok;

    # Info and debug messages are created by calling log_info and
    # log_debug, respectively
    log_info  ( "Info-level message"  );
    log_debug ( "Debug-level message" );

    # Arbitrary log message (use sparingly -- see App::CELL::Status
    # for a way to trigger higher-level log messages
    App::CELL::Log::arbitrary( 'WARN', "Be warned!" );

    # Log a status object (don't do this: it happens automatically when
    # status object is constructed)
    App::CELL::Log::status_obj( $status_obj );

EXPORTS

This module exports the following functions:

log_debug
log_info

PACKAGE VARIABLES

$ident - the name of our application
$log_level - value linked to the CELL_DEBUG_MODE site param; must be a level recognized by Log::Fast
@permitted_levels - list of permissible log levels

DESCRIPTION

The App::CELL::Log module provides for "log-only messages" (see Localization section of the top-level README for a discussion of the different types of CELL messages).

FUNCTIONS

configure

Configures logging the way we like it. Takes one argument: the 'ident' (identifier) string, which will probably be the application name. If not given, defaults to 'CELL'. Returns status object.

TO DO: get ident and default log-level from site configuration, if available. TO DO: if we've already completed CELL server initialization, return without doing anything

Returns: true on success, false on failure

log_debug

Exportable function. Takes a string and writes it to syslog with log level "DEBUG". Always returns true.

log_info

Exportable function. Takes a string and writes it to syslog with log level "INFO". Always returns true.

arbitrary

Write an arbitrary message to any log level. Takes two string arguments: log level and message to write.

status_obj

Take a status object and log it.