| Business::Shipping::KLogging - Logging interface |
Business::Shipping::KLogging - Logging interface
Wrapper for Log::Log4perl. Must be initialized before use. Recommend usage is via your own wrapper. See Business::Shipping::Logging as an example wrapper.
For long debug messages (entire XML output, etc.). Prepends "debug3" to the category, allowing the user to filter out very verbose debug messages in config/log4perl.conf.
Arguments:
file => 'path/to/file', # Required caller_depth => $interger, # Optional once => true/false # Optional
caller_depth:
If you are using one wrapper on top of this module, the caller_depth should be set to 2. For example:
Log::Log4perl | | Business::Shipping::KLogging | | MyNameSpace::Logging once: If true, calls init_once (which ignores any settings if init has already been called once). =cut
sub init { my ( %opt ) = @_;
my $file = $opt{ file };
my $caller_depth = $opt{ caller_depth };
my $once = $opt{ once };
if ( not $file ) {
carp "file arg required.";
return;
}
if ( -f $file ) {
if ( $once )
{ Log::Log4perl::init_once( $file ); }
else
{ Log::Log4perl::init( $file ); }
}
else
{ croak "Could not get log4perl config file: $file"; }
${Log::Log4perl::caller_depth} = $caller_depth if $caller_depth;
return;
}
Private function.
Automatically uses the package name and subroutine as the log4perl 'category'.
Takes any built-in object and returns the perl representation of it as a string of text. It was copied from Interchange http://www.icdevgroup.org, written by Mike Heins <mike@perusion.com>.
Dan Browning <db@kavod.com>, Kavod Technologies, http://www.kavod.com.
Copyright (c) 2003-2004 Kavod Technologies, Dan Browning. All rights reserved. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. See LICENSE for more info.
Sub uneval copyright (c) 2002-2003 Interchange Development Group.
| Business::Shipping::KLogging - Logging interface |