| SVN-S4 documentation | view source | Contained in the SVN-S4 distribution. |
SVN::S4::Debug - Allow debug messages to be easily switched on and off.
use SVN::S4::Debug qw(INFO DEBUG is_debug);
INFO ("informational message");
DEBUG ("debug message") if is_debug>=2;
SVN::S4::Debug functions are used instead of print, to allow control over all log messages work in a unified way.
Debug levels can be controlled globally, or via a per-package $Debug variable that is created automatically. (However, it's more general to test the is_debug method in scripts, unless it is a very hot function.)
Conventions for inside BugVise (but not required by this module) are that debug level 1 is for high-level messages for program debug. Levels 2 and above are for package debug, 2 being common, and above 2 being very verbose.
Print an informational message.
Print a debug message.
Enable debug on all modules, based on the command line argument passed. This is typically called from a Getopt::Long parser. Options supported are: "--debug" will set debug level 1 globally, and "--debugi {level}" will set the global debug level to the specified value. "--debugi {package}:{level}" to set debug on one package, and will also work on any package that uses a $Debug variable.
Enable debug on all modules.
Return current debug level, or zero if not enabled.
Enable debug on the current package.
If true, print timestamps as relative to the last printout.
If set, parse the contents of BUGVISE_DEBUG as a debug_option() at package start time.
Copyright 2007-2011 by Wilson Snyder. This package is free software; you can redistribute it and/or modify it under the terms of either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0.
Wilson Snyder <wsnyder@wsnyder.org>
| SVN-S4 documentation | view source | Contained in the SVN-S4 distribution. |