Log::Trace is a Perl module to provide a unified approach to tracing. A script can use Log::Trace qw( < mode > ) to set the behaviour of the TRACE function.
By default, the trace functions are exported to the calling package only. You can export the trace functions to other packages with the Deep option. See "OPTIONS" for more information.
All exports are in uppercase (to minimise collisions with "real" functions).
SYNOPSIS
# The tracing targets
use Log::Trace; # No output
use Log::Trace 'print'; # print to STDOUT
use Log::Trace log => '/var/log/foo.log'; # Output to log file
use Log::Trace print => { Level => 3 };
# Switch on/off logging with a constant
use Log::Trace;
import Log::Trace ('log' => LOGFILE) if TRACING;
# Set up tracing for all packages that advertise TRACE
use Foo;
use Bar;
use Log::Trace warn => { Deep => 1 };
# Sets up tracing in all subpackages excluding Foo
use Log::Trace warn => {Deep => 1, 'Exclude' => 'Foo'};
# Exported functions
TRACE("Record this...");
TRACE({Level => 2}, "Only shown if tracing level is 2 or higher");
TRACEF("A la printf: %d-%.2f", 1, 2.9999);
TRACE_HERE(); # Record where we are (file, line, sub, args)
DUMP(@loh, \%hoh); # Trace out via Data::Dumper
DUMP("Title", @loh); # Trace out via Data::Dumper
my $dump = DUMP(@args); # Dump is returned without being traced
Product's homepage
Requirements:
· Perl