ZoneMinder::Logger(3pm) | User Contributed Perl Documentation | ZoneMinder::Logger(3pm) |
ZoneMinder::Logger - ZoneMinder Logger module
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' );
The ZoneMinder:Logger module contains the common debug and error reporting routines used by the ZoneMinder scripts.
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.
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.
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.
To disable any of these action entirely set to NOLOG
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.
Carp Sys::Syslog
The ZoneMinder README file Troubleshooting section for an extended discussion on the use and configuration of syslog with ZoneMinder.
http://www.zoneminder.com
Philip Coombes, <philip.coombes@zoneminder.com>
Copyright (C) 2001-2008 Philip Coombes
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.
2023-02-24 | perl v5.36.0 |