260 lines
11 KiB
Groff
260 lines
11 KiB
Groff
.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16)
|
|
.\"
|
|
.\" 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" ''
|
|
'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.
|
|
.ie \nF \{\
|
|
. de IX
|
|
. tm Index:\\$1\t\\n%\t"\\$2"
|
|
..
|
|
. nr % 0
|
|
. rr F
|
|
.\}
|
|
.el \{\
|
|
. de IX
|
|
..
|
|
.\}
|
|
.\"
|
|
.\" 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 "ZoneMinder::Logger 3pm"
|
|
.TH ZoneMinder::Logger 3pm "2012-07-17" "perl v5.14.2" "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"
|
|
ZoneMinder::Logger \- ZoneMinder Logger module
|
|
.SH "SYNOPSIS"
|
|
.IX Header "SYNOPSIS"
|
|
.Vb 2
|
|
\& use ZoneMinder::Logger;
|
|
\& use ZoneMinder::Logger qw(:all);
|
|
\&
|
|
\& logInit( "myproc", DEBUG );
|
|
\&
|
|
\& Debug( "This is what is happening" );
|
|
\& Info( "Something interesting is happening" );
|
|
\& Warning( "Something might be going wrong." );
|
|
\& Error( "Something has gone wrong!!" );
|
|
\& Fatal( "Something has gone badly wrong, gotta stop!!" );
|
|
\& Panic( "Something fundamental has gone wrong, die with stack trace );
|
|
.Ve
|
|
.SH "DESCRIPTION"
|
|
.IX Header "DESCRIPTION"
|
|
The ZoneMinder:Logger module contains the common debug and error reporting routines used by the ZoneMinder scripts.
|
|
.PP
|
|
To use debug in your scripts you need to include this module, and call logInit. Thereafter you can sprinkle Debug or Error calls etc throughout the code safe in the knowledge that they will be reported to your error log, and possibly the syslogger, in a meaningful and consistent format.
|
|
.PP
|
|
Debug is discussed in terms of levels where 1 and above (currently only 1 for scripts) is considered debug, 0 is considered as informational, \-1 is a warning, \-2 is an error and \-3 is a fatal error or panic. Where levels are mentioned below as thresholds the value given and anything with a lower level (ie. more serious) will be included.
|
|
.SH "METHODS"
|
|
.IX Header "METHODS"
|
|
.ie n .IP "logInit ( $id, %options );" 4
|
|
.el .IP "logInit ( \f(CW$id\fR, \f(CW%options\fR );" 4
|
|
.IX Item "logInit ( $id, %options );"
|
|
Initialises the debug and prepares the logging for forthcoming operations. If not called explicitly it will be called by the first debug call in your script, but with default (and probably meaningless) options. The only compulsory arguments are \f(CW$id\fR which must be a string that will identify debug coming from this script in mixed logs. Other options may be provided as below,
|
|
.Sp
|
|
.Vb 8
|
|
\& Option Default Description
|
|
\& \-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-
|
|
\& level INFO The initial debug level which defines which statements are output and which are ignored
|
|
\& trace 0 Whether to use the Carp::shortmess format in debug statements to identify where the debug was emitted from
|
|
\& termLevel NOLOG At what level debug is written to terminal standard error, 0 is no, 1 is yes, 2 is write only if terminal
|
|
\& databaseLevel INFO At what level debug is written to the Log table in the database;
|
|
\& fileLevel NOLOG At what level debug is written to a log file of the format of <id>.log in the standard log directory.
|
|
\& syslogLevel INFO At what level debug is written to syslog.
|
|
.Ve
|
|
.Sp
|
|
To disable any of these action entirely set to \s-1NOLOG\s0
|
|
.IP "logTerm ();" 4
|
|
.IX Item "logTerm ();"
|
|
Used to end the debug session and close any logs etc. Not usually necessary.
|
|
.ie n .IP "$id = logId ( [$id] );" 4
|
|
.el .IP "\f(CW$id\fR = logId ( [$id] );" 4
|
|
.IX Item "$id = logId ( [$id] );"
|
|
.PD 0
|
|
.ie n .IP "$level = logLevel ( [$level] );" 4
|
|
.el .IP "\f(CW$level\fR = logLevel ( [$level] );" 4
|
|
.IX Item "$level = logLevel ( [$level] );"
|
|
.ie n .IP "$trace = logTrace ( [$trace] );" 4
|
|
.el .IP "\f(CW$trace\fR = logTrace ( [$trace] );" 4
|
|
.IX Item "$trace = logTrace ( [$trace] );"
|
|
.ie n .IP "$level = logLevel ( [$level] );" 4
|
|
.el .IP "\f(CW$level\fR = logLevel ( [$level] );" 4
|
|
.IX Item "$level = logLevel ( [$level] );"
|
|
.ie n .IP "$termLevel = logTermLevel ( [$termLevel] );" 4
|
|
.el .IP "\f(CW$termLevel\fR = logTermLevel ( [$termLevel] );" 4
|
|
.IX Item "$termLevel = logTermLevel ( [$termLevel] );"
|
|
.ie n .IP "$databaseLevel = logDatabaseLevel ( [$databaseLevel] );" 4
|
|
.el .IP "\f(CW$databaseLevel\fR = logDatabaseLevel ( [$databaseLevel] );" 4
|
|
.IX Item "$databaseLevel = logDatabaseLevel ( [$databaseLevel] );"
|
|
.ie n .IP "$fileLevel = logFileLevel ( [$fileLevel] );" 4
|
|
.el .IP "\f(CW$fileLevel\fR = logFileLevel ( [$fileLevel] );" 4
|
|
.IX Item "$fileLevel = logFileLevel ( [$fileLevel] );"
|
|
.ie n .IP "$syslogLevel = logSyslogLevel ( [$syslogLevel] );" 4
|
|
.el .IP "\f(CW$syslogLevel\fR = logSyslogLevel ( [$syslogLevel] );" 4
|
|
.IX Item "$syslogLevel = logSyslogLevel ( [$syslogLevel] );"
|
|
.PD
|
|
These methods can be used to get and set the current settings as defined in logInit.
|
|
.ie n .IP "Debug( $string );" 4
|
|
.el .IP "Debug( \f(CW$string\fR );" 4
|
|
.IX Item "Debug( $string );"
|
|
This method will output a debug message if the current debug level permits it, otherwise does nothing. This message will be tagged with the \s-1DBG\s0 string in the logs.
|
|
.ie n .IP "Info( $string );" 4
|
|
.el .IP "Info( \f(CW$string\fR );" 4
|
|
.IX Item "Info( $string );"
|
|
This method will output an informational message if the current debug level permits it, otherwise does nothing. This message will be tagged with the \s-1INF\s0 string in the logs.
|
|
.ie n .IP "Warning( $string );" 4
|
|
.el .IP "Warning( \f(CW$string\fR );" 4
|
|
.IX Item "Warning( $string );"
|
|
This method will output a warning message if the current debug level permits it, otherwise does nothing. This message will be tagged with the \s-1WAR\s0 string in the logs.
|
|
.ie n .IP "Error( $string );" 4
|
|
.el .IP "Error( \f(CW$string\fR );" 4
|
|
.IX Item "Error( $string );"
|
|
This method will output an error message if the current debug level permits it, otherwise does nothing. This message will be tagged with the \s-1ERR\s0 string in the logs.
|
|
.ie n .IP "Fatal( $string );" 4
|
|
.el .IP "Fatal( \f(CW$string\fR );" 4
|
|
.IX Item "Fatal( $string );"
|
|
This method will output a fatal error message and then die if the current debug level permits it, otherwise does nothing. This message will be tagged with the \s-1FAT\s0 string in the logs.
|
|
.ie n .IP "Panic( $string );" 4
|
|
.el .IP "Panic( \f(CW$string\fR );" 4
|
|
.IX Item "Panic( $string );"
|
|
This method will output a panic error message and then die with a stack trace if the current debug level permits it, otherwise does nothing. This message will be tagged with the \s-1PNC\s0 string in the logs.
|
|
.SS "\s-1EXPORT\s0"
|
|
.IX Subsection "EXPORT"
|
|
None by default.
|
|
The :constants tag will export the debug constants which define the various levels of debug
|
|
The :variables tag will export variables containing the current debug id and level
|
|
The :functions tag will export the debug functions. This or :all is what you would normally use.
|
|
The :all tag will export all above symbols.
|
|
.SH "SEE ALSO"
|
|
.IX Header "SEE ALSO"
|
|
Carp
|
|
Sys::Syslog
|
|
.PP
|
|
The ZoneMinder \s-1README\s0 file Troubleshooting section for an extended discussion on the use and configuration of syslog with ZoneMinder.
|
|
.PP
|
|
http://www.zoneminder.com
|
|
.SH "AUTHOR"
|
|
.IX Header "AUTHOR"
|
|
Philip Coombes, <philip.coombes@zoneminder.com>
|
|
.SH "COPYRIGHT AND LICENSE"
|
|
.IX Header "COPYRIGHT AND LICENSE"
|
|
Copyright (C) 2001\-2008 Philip Coombes
|
|
.PP
|
|
This library is free software; you can redistribute it and/or modify
|
|
it under the same terms as Perl itself, either Perl version 5.8.3 or,
|
|
at your option, any later version of Perl 5 you may have available.
|
|
.SH "POD ERRORS"
|
|
.IX Header "POD ERRORS"
|
|
Hey! \fBThe above document had some coding errors, which are explained below:\fR
|
|
.IP "Around line 830:" 4
|
|
.IX Item "Around line 830:"
|
|
You forgot a '=back' before '=head2'
|