NAME
Util::Medley::Logger - Yet another class for logging.
VERSION
version 0.062
SYNOPSIS
my $log = Util::Medley::Logger->new;
$log->fatal($msg);
$log->error($msg);
$log->warn($msg);
$log->info($msg);
$log->verbose(Smsg);
$log->debug($msg);
$log->deprecated("old()", "new()");
DESCRIPTION
A simple logging class. By default all logs are written to stderr.
ATTRIBUTES
disableStderr
If provided and true, will disable logging messages to stderr. You should use the 'filename' attribute if you provide true.
filename
If provided, indicates where to write log messages. This will not disable stderr. To do that use disableStderr().
Note that file locking is used when writing to a file. This allows you to have multiple processes writing to the same log file without stomping on each other.
logDetailLevel (<int>)
Used to indicate how much detail to output with each message. Here is a breakdown:
1 - <msg>
2 - [level] <msg>
3 - [level] [date] <msg>
4 - [level] [date] [pid] <msg>
5 - [level] [date] [pid] [caller($frames)] <msg>
logDetailLevelDebug
Get or set the logDetailLevelDebug value. This overrides the logDetailLevel.
logDetailLevelVerbose
Get or set the logDetailLevelVerbose value. This overrides the logDetailLevel.
logDetailLevelInfo
Get or set the logDetailLevelInfo value. This overrides the logDetailLevel.
logDetailLevelWarn
Get or set the logDetailLevelWarn value. This overrides the logDetailLevel.
logDetailLevelError
Get or set the logDetailLevelError value. This overrides the logDetailLevel.
logDetailLevelFatal
Get or set the logDetailLevelFatal value. This overrides the logDetailLevel.
logDetailLevelDeprecated
Get or set the logDetailLevelDeprecated value. This overrides the logDetailLevel.
logFrames
Used to indicate how many frames to go back when logDetailLevel invokes the caller() function. In most cases you shouldn't have to bother with this.
logLevel
Indicates what level of log detail you want.
Levels (in order of severity):
- debug
- verbose
- info
- warn
- error
- fatal
utf8
Flag to toggle utf8 mode.
METHODS
debug
Writes a debug message to the log.
deprecated
Writes a deprecated message to the log. First arg is the original method/sub. Second arg is the new method/sub.
error
Writes an error message to the log.
fatal
Writes a fatal message to the log and exits with 1.
getLogLevels
Returns an array of all possible levels in severity order.
info
Writes an info message to the log.
verbose
Writes a verbose message to the log.
warn
Writes a warn message to the log.