.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Log::Handler::Levels 3pm" .TH Log::Handler::Levels 3pm "2014-10-24" "perl v5.20.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Log::Handler::Levels \- All levels for Log::Handler. .SH "DESCRIPTION" .IX Header "DESCRIPTION" Base class for Log::Handler. .PP Just for internal usage and documentation. .SH "METHODS" .IX Header "METHODS" .SS "Default log level" .IX Subsection "Default log level" .IP "\fB\f(BIdebug()\fB\fR" 4 .IX Item "debug()" .PD 0 .IP "\fB\f(BIinfo()\fB\fR" 4 .IX Item "info()" .IP "\fB\f(BInotice()\fB\fR" 4 .IX Item "notice()" .IP "\fB\f(BIwarning()\fB\fR, \fB\f(BIwarn()\fB\fR" 4 .IX Item "warning(), warn()" .IP "\fB\f(BIerror()\fB\fR, \fB\f(BIerr()\fB\fR" 4 .IX Item "error(), err()" .IP "\fB\f(BIcritical()\fB\fR, \fB\f(BIcrit()\fB\fR" 4 .IX Item "critical(), crit()" .IP "\fB\f(BIalert()\fB\fR" 4 .IX Item "alert()" .IP "\fB\f(BIemergency()\fB\fR, \fB\f(BIemerg()\fB\fR" 4 .IX Item "emergency(), emerg()" .PD .SS "Checking for active levels" .IX Subsection "Checking for active levels" .IP "\fB\f(BIis_debug()\fB\fR" 4 .IX Item "is_debug()" .PD 0 .IP "\fB\f(BIis_info()\fB\fR" 4 .IX Item "is_info()" .IP "\fB\f(BIis_notice()\fB\fR" 4 .IX Item "is_notice()" .IP "\fB\f(BIis_warning()\fB\fR, \fB\f(BIis_warn()\fB\fR" 4 .IX Item "is_warning(), is_warn()" .IP "\fB\f(BIis_error()\fB\fR, \fB\f(BIis_err()\fB\fR" 4 .IX Item "is_error(), is_err()" .IP "\fB\f(BIis_critical()\fB\fR, \fB\f(BIis_crit()\fB\fR" 4 .IX Item "is_critical(), is_crit()" .IP "\fB\f(BIis_alert()\fB\fR" 4 .IX Item "is_alert()" .IP "\fB\f(BIis_emergency()\fB\fR, \fB\f(BIis_emerg()\fB\fR" 4 .IX Item "is_emergency(), is_emerg()" .PD .SS "Special level" .IX Subsection "Special level" .IP "\fB\f(BIfatal()\fB\fR" 4 .IX Item "fatal()" Alternative for the levels \f(CW\*(C`critical\*(C'\fR \- \f(CW\*(C`emergency\*(C'\fR. .IP "\fB\f(BIis_fatal()\fB\fR" 4 .IX Item "is_fatal()" Check if one of the levels \f(CW\*(C`critical\*(C'\fR \- \f(CW\*(C`emergency\*(C'\fR is active. .SS "Special methods" .IX Subsection "Special methods" .IP "\fB\f(BItrace()\fB\fR" 4 .IX Item "trace()" This method is very useful if you want to add a full backtrace to your message. Maybe you want to intercept unexpected errors and want to know who called \f(CW\*(C`die()\*(C'\fR. .Sp .Vb 1 \& $SIG{_\|_DIE_\|_} = sub { $log\->trace(emergency => @_) }; .Ve .Sp By default the backtrace is logged as level \f(CW\*(C`debug\*(C'\fR. .Sp .Vb 2 \& # would log with the level debug \& $log\->trace(\*(Aqwho called who\*(Aq); .Ve .Sp If you want to log with another level then you can pass the level as first argument: .Sp .Vb 1 \& $log\->trace(info => $message); .Ve .IP "\fB\f(BIdump()\fB\fR" 4 .IX Item "dump()" If you want to dump something then you can use \f(CW\*(C`dump()\*(C'\fR. The default level is \f(CW\*(C`debug\*(C'\fR. .Sp .Vb 1 \& my %hash = (foo => 1, bar => 2); \& \& $log\->dump(\e%hash); .Ve .Sp If you want to log with another level then you can pass the level as first argument: .Sp .Vb 1 \& $log\->dump($level => \e%hash); .Ve .IP "\fB\f(BIdie()\fB\fR" 4 .IX Item "die()" This method logs the message to the output and then call \f(CW\*(C`Carp::croak()\*(C'\fR with the level \f(CW\*(C`emergency\*(C'\fR by default. .Sp .Vb 1 \& $log\->die(\*(Aqan emergency error here\*(Aq); .Ve .Sp If you want to log with another level, then you can pass the level as first argument: .Sp .Vb 1 \& $log\->die(fatal => \*(Aqan emergency error here\*(Aq); .Ve .IP "\fB\f(BIlog()\fB\fR" 4 .IX Item "log()" With this method it's possible to log messages with the log level as first argument: .Sp .Vb 1 \& $log\->log(info => \*(Aqan info message\*(Aq); .Ve .Sp Is the same like .Sp .Vb 1 \& $log\->info(\*(Aqan info message\*(Aq); .Ve .Sp and .Sp .Vb 1 \& $log\->log(\*(Aqan info message\*(Aq); .Ve .Sp If you log without a level then the default level is \f(CW\*(C`info\*(C'\fR. .SH "PREREQUISITES" .IX Header "PREREQUISITES" .Vb 2 \& Carp \& Data::Dumper .Ve .SH "EXPORTS" .IX Header "EXPORTS" No exports. .SH "REPORT BUGS" .IX Header "REPORT BUGS" Please report all bugs to . .PP If you send me a mail then add Log::Handler into the subject. .SH "AUTHOR" .IX Header "AUTHOR" Jonny Schulz . .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (C) 2007\-2009 by Jonny Schulz. All rights reserved. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.