SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG
DONATE


YUM REPOSITORY

 
 

MAN page from Fedora 28 perl-Log-TraceMessages-1.4-27.fc28.noarch.rpm

TraceMessages

Section: User Contributed Perl Documentation (3)
Updated: 2003-12-05
Index 

NAME

Log::TraceMessages - Perl extension for trace messages used in debugging 

SYNOPSIS

  use Log::TraceMessages qw(t d);  $Log::TraceMessages::On = 1;  t 'got to here';  t 'value of $a is ' . d($a);  {      local $Log::TraceMessages::On = 0;      t 'this message will not be printed';  }  $Log::TraceMessages::Logfile = 'log.out';  t 'this message will go to the file log.out';  $Log::TraceMessages::Logfile = undef;  t 'and this message is on stderr as usual';  # For a CGI program producing HTML  $Log::TraceMessages::CGI = 1;  # Or to turn on trace if there's a command-line argument '--trace'  Log::TraceMessages::check_argv();
 

DESCRIPTION

This module is a slightly better way to put trace statements into yourcode than just calling print(). It provides an easy way to turn traceon and off for particular sections of code without having to commentout bits of source. 

USAGE

$Log::TraceMessages::On
Flag controlling whether tracing is on or off. You can set it as youwish, and of course it can be "local"-ized. The default is off.
$Log::TraceMessages::Logfile
The name of the file to which trace should be appended. If this isundefined (which is the default), then trace will be written tostderr, or to stdout if $CGI is set.
$Log::TraceMessages::CGI
Flag controlling whether the program printing trace messages is a CGIprogram (default is no). This means that trace messages will beprinted as HTML. Unless $Logfile is also set, messages will beprinted to stdout so they appear in the output page.
t(messages)
Print the given strings, if tracing is enabled. Unless $CGI istrue or $Logfile is set, each message will be printed to stderrwith a newline appended.
trace(messages)
Synonym for "t(messages)".
d(scalar)
Return a string representation of a scalar's value suitable foruse in a trace statement. This is just a wrapper for Data::Dumper.

"d()" will exit with '' if trace is not turned on. This is tostop your program being slowed down by generating lots of strings fortrace statements that are never printed.

dmp(scalar)
Synonym for "d(scalar)".
check_argv()
Looks at the global @ARGV of command-line parameters to find onecalled '--trace'. If this is found, it will be removed from @ARGVand tracing will be turned on. Since tracing is off by default,calling "check_argv()" is a way to make your program print trace onlywhen you ask for it from the command line.
 

AUTHOR

Ed Avis, edAATTmembled.com 

SEE ALSO

perl(1), Data::Dumper(3). 

POD ERRORS

Hey! The above document had some coding errors, which are explained below:
Around line 218:
You forgot a '=back' before '=head1'


 

Index

NAME
SYNOPSIS
DESCRIPTION
USAGE
AUTHOR
SEE ALSO
POD ERRORS

This document was created byman2html,using the manual pages.