The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

XAS::Lib::Log - A class for logging in the XAS Environment

SYNOPSIS

    use XAS::Lib::Log;

    my $log = XAS::Lib::Log->new();

    $log->debug('a debug message');
    $log->info('an info message');
    $log->warn('a warning message');
    $log->error('an error message');
    $log->fatal('a fatal error message');
    $log->trace('a tracing message');

DESCRIPTION

This module defines a simple logger for messages generated by an application. It is intentionally very simple in design, providing the bare minimum in functionality with the possibility for extension by sub-classing.

METHODS

new

This will initialize the base object.

level($level, $boolean)

This will query or toggle the log level. When toggled that particular level is set. There is no hierarchy of log levels.

$level

The log level to toggle. This can be one of the following:

 info, warn, error, fatal, debug, trace
$boolean

An optional valve. It needs to be 0 or 1 to set the level.

info($line)

This method will log an entry with an level of "info".

$line

The message to write out. This can be an array which will be joined with a "space" separator.

warn($line)

This method will log an entry with an level of "warn".

$line

The message to write out. This can be an array which will be joined with a "space" separator.

error($line)

This method will log an entry with an level of "error".

$line

The message to write out. This can be an array which will be joined with a "space" separator.

fatal($line)

This method will log an entry with an level of "fatal".

$line

The message to write out. This can be an array which will be joined with a "space" separator.

debug($line)

This method will log an entry with an level of "debug". By default this level is turned off.

$line

The message to write out. This can be an array which will be joined with a "space" separator.

trace($line)

This method will log an entry with an level of "trace".

$line

The line to write out. This can be an array which will be joined with a "space" separator.

info_msg($message, ...)

This method will log an entry with an level of "info".

$message

The pre-defined message string. Usually in a message file.

...

The items to be used in the pre-defined message.

warn_msg($message, ...)

This method will log an entry with an level of "warn".

$message

The pre-defined message string. Usually in a message file.

...

The items to be used in the pre-defined message.

error_msg($message, ...)

This method will log an entry with an level of "error".

$message

The pre-defined message string. Usually in a message file.

...

The items to be used in the pre-defined message.

fatal_msg($message, ...)

This method will log an entry with an level of "fatal".

$message

The pre-defined message string. Usually in a message file.

...

The items to be used in the pre-defined message.

debug_msg($message, ...)

This method will log an entry with an level of "debug".

$message

The pre-defined message string. Usually in a message file.

...

The items to be used in the pre-defined message.

trace_msg($message, ...)

This method will log an entry with an level of "trace".

$message

The pre-defined message string. Usually in a message file.

...

The items to be used in the pre-defined message.

SEE ALSO

XAS::Lib::Log::Console
XAS::Lib::Log::File
XAS::Lib::Log::Json
XAS::Lib::Log::Syslog
XAS

AUTHOR

Kevin L. Esteb, <kevin@kesteb.us>

COPYRIGHT AND LICENSE

Copyright (c) 2012-2015 Kevin L. Esteb

This is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0. For details, see the full text of the license at http://www.perlfoundation.org/artistic_license_2_0.