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

NAME

Log::Handler::Levels - All levels for Log::Handler.

DESCRIPTION

METHODS

Log level methods

debug()
info()
notice()
warning()
error()
err()
critical()
crit()
alert()
emergency()
emerg()

Checking for active levels

is_debug()
is_info()
is_notice()
is_warning()
is_error()
is_err()
is_critical()
is_crit()
is_alert()
is_emergency()
is_emerg()

Special level

fatal()

Alternative for the levels critical - emergency.

is_fatal()

Check if one of the levels critical - emergency is active.

Log and trace

These methods are useful if you want to add a full backtrace to your message.

Maybe you like do something like

    $SIG{__DIE__} = sub { $log->fatal_and_trace(@_) };

Or just if you want to know who called who

    $log->info_and_trace('who called who');
debug_and_trace()
info_and_trace()
notice_and_trace()
warning_and_trace()
error_and_trace()
err_and_trace()
critical_and_trace()
crit_and_trace()
alert_and_trace()
emergency_and_trace()
emerg_and_trace()
fatal_and_trace()

Log and exit

The default exit code is 1

    $log->error_and_exit('an error happends')

Pass the exit code yourself

    $log->error_and_exit(9 => 'an error happends')
    $log->info_and_exit(0 => 'program stopped')

Note that if the first argument is a number then this number is used as exit code.

debug_and_exit()
info_and_exit()
notice_and_exit()
warning_and_exit()
error_and_exit()
err_and_exit()
critical_and_exit()
crit_and_exit()
alert_and_exit()
emergency_and_exit()
emerg_and_exit()
fatal_and_exit()

Log and die methods

Log the message to the output and execute Carp::croak().

error_and_die()
err_and_die()
critical_and_die()
crit_and_die()
alert_and_die()
emergency_and_die()
emerg_and_die()
fatal_and_die()

Log and croak methods

Log the message to the output and execute Carp::croak() with CarpLevel+3.

error_and_croak()
err_and_croak()
critical_and_croak()
crit_and_croak()
alert_and_croak()
emergency_and_croak()
emerg_and_croak()
fatal_and_croak()

Log and warn methods

carp()
    Log the message as warning to the output and execute C<Carp::carp> with C<CarpLevel+3>.
warn()
    Log the message as warning to the output and execute C<Carp::carp>.

PREREQUISITES

    Carp

EXPORTS

No exports.

REPORT BUGS

Please report all bugs to <jschulz.cpan(at)bloonix.de>.

AUTHOR

Jonny Schulz <jschulz.cpan(at)bloonix.de>.

COPYRIGHT

Copyright (C) 2007 by Jonny Schulz. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.