NAME

Algorithm::Genetic::Diploid::Logger - reports on progress of the experiment

METHODS

new

This singleton constructor always returns reference to same object

level

Alters log level. Takes named arguments: method provides a scalar or array of fully qualified method names whose verbosity to alter. class provides a scalar or array of package names whose verbosity to alter. level sets the verbosity to one of the levels described below.

formatter

Alters log string formatter. When argument is 'simple' the log string is just the logging level and message, when argument is 'verbose', the log string has the calling subroutine name and location in it. 'medium' omits the file location. When the argument is a code reference, this reference is executed for every log message, with the following named arguments:

'level' => (DEBUG|INFO|WARN|ERROR|FATAL)
'sub'   => fully qualified name of the calling subroutine
'file'  => path to the calling file
'line'  => line number from whence the call was made
'msg'   => the log message

VERBOSITY LEVELS

The following constants are available when using this package with the use qualifier ':levels', i.e. use Algorithm::Genetic::Diploid::Logger ':levels';. They represent different verbosity levels that can be set globally, and/or at package level, and/or at method level.

FATAL

Only most severe messages are transmitted.

ERROR

Possibly unrecoverable errors are transmitted.

WARN

Warnings are transmitted. This is the default.

INFO

Informational messages are transmitted.

DEBUG

Everything is transmitted, including debugging messages.