NAME

Bio::Gonzales::Util::Log - basic logging for Bio::Gonzales

SYNOPSIS

# logs to stderr by default
my $l = Bio::Gonzales::Util::Log->new();
$l->info("started application");

DESCRIPTION

First of all: Shamelessly stolen from Mojo::Log, thanks to Sebastian Riedel & contributors for creating it.

METHODS

$log->path($file)

Sets or gets the log file path. If not set, STDERR is used.

$log->level($level)

Sets or gets the threshold level for logging. Everything lower than this level will not be logged. By default debug.

$log->namespace($namespace)

Sets or gets the namespace of the logger.

$log->tee_stderr($bool)

Log to file and STDERR. If no path is set, setting this option has no effect.

$log->append($bool)

If 1, the logger appends the log output to the log file.

$log->debug(@lines)

Log debug message.

$log->error(@lines)

Log error message.

$log->warn(@lines)

Log warning message.

$log->fatal(@lines)

Log fatal message.

$log->info(@lines)

Log info message.

$log_text = $log->format($level, @lines)

Format @lines and return the formatted text.

$log->is_debug

Return true if log level is debug.

$log->is_error

Return true if log level is error.

$log->is_fatal

Return true if log level is fatal.

$log->is_info

Return true if log level is info.

$log->is_warn

Return true if log level is warn.

$log->is_level($level)

Return true if log level is $level

$log->log($level, @lines)

Logs $lines with $level to log destination.

SEE ALSO

Mojo::Log

AUTHOR

jw bargsten, <jwb at cpan dot org>