Thorium::Log - Logging support
version 0.510
use Thorium::Log; my $log = Thorium::Log->new(); $log->warn('Some warning message');
Thorium::Log is a high level wrapper class around Log::Log4perl's functionality. It exists to replace all prints and says. See Thorium::Roles::Logging for adding logging support via $self-log->...> to your object. You are encouraged to subclass and set prefix().
print
say
$self-
prefix()
add_benchmarks (rw, Bool)
rw
Bool
Every time a log message is output ($log->$level($message)), additionally outputs a benchmark time line with the time elapsed since the last log message was output. Defaults to '0'.
caller_depth (rw, Int)
Int
Determines (additional) depth for caller inside Log4Perl. Defaults to '1'.
category (ro, Str)
ro
Str
The category to use for Log::Log4Perl. This is used to set category specific log levels in the configuration. Default is the name of the package in which the Thorium::Log object was created.
config_file (rw, Str)
The location of the configuration file to read. You may set the environment variable THORIUM_LOG_CONF_FILE otherwise /etc/thorium/log.conf will be used. An example is provided in this distribution under conf/log.conf. See Log::Log4Perl for details.
THORIUM_LOG_CONF_FILE
die_on_fatal (rw, Bool)
Allows automatic die()ing for the fatal level. Defaults to '0'.
die()
trace($str_or_ref, ...)
debug($str_or_ref, ...)
info($str_or_ref, ...)
warn($str_or_ref, ...)
error($str_or_ref, ...)
fatal($str_or_ref, ...)
carp($str_or_ref, ...)
Warn with one level of a stack trace.
cluck($str_or_ref, ...)
Warn with full stack trace.
confress($str_or_ref, ...)
Die with one level of a stack trace.
croak($str_or_ref, ...)
Die with full stack trace.
Adam Flott <adam@npjh.com>
This software is copyright (c) 2011 by Adam Flott <adam@npjh.com>, CIDC.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Thorium, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Thorium
CPAN shell
perl -MCPAN -e shell install Thorium
For more information on module installation, please visit the detailed CPAN module installation guide.