From 5cc1afa0d90f96ca75957ddaa0032d2211052fe8 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 21 Jun 2011 10:55:48 +0200 Subject: [PATCH] =?utf8?q?Dokumentation=20f=C3=BCr=20SL/LXDebug.pm?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/LXDebug.pm | 184 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 184 insertions(+) diff --git a/SL/LXDebug.pm b/SL/LXDebug.pm index 397b179ef..abbb035db 100644 --- a/SL/LXDebug.pm +++ b/SL/LXDebug.pm @@ -331,3 +331,187 @@ sub level_by_name { } 1; +__END__ + +=pod + +=encoding utf8 + +=head1 NAME + +LXDebug - Lx-Office debugging facilities + +=head1 SYNOPSIS + +This module provides functions for debugging Lx-Office. An instance is +always created as the global variable C<$::lxdebug> at the earliest +possible moment. + +Debugging is mostly logging of information. Each log function has a +I and an I to be logged. The configuration file as well +as this module's functions determine which levels get logged, and +which file they're logged to. + +=head1 LOG LEVELS + +The available log levels are: + +=over 4 + +=item C + +Always output the message regardless of the active levels. Only use +this temporarily. + +=item C + +Informational, not an error, more important than C. + +=item C + +Important debugging information. + +=item C + +Less important debugging information that occurs often and spams the +log. + +=item C + +Log all queries executed by the L utility methods. + +=item C + +Log sub calls and exits via the L/L functions. + +=item C + +Log a stack trace when an error is output. + +=item C + +Log each request's total execution time when it finishes. + +=item C + +Important warnings. + +=item C + +All of the above. + +=item C + +Shortcut for C. + +=back + +=head1 FUNCTIONS + +=over 4 + +=item C + +=item C + +Pairs of these can be put near the beginning/end of a sub. They'll +cause a trace to be written to the log file if the C level is +active. + +If C<$level> is given then the log messages will only be logged if an +additional log level C<$level> is active as well. + +=item C + +=item C + +Enables/disables sub tracing with L/L temporarily. + +=item C + +Returns whether or not the C debug level is active. + +=item C + +Logs a stack backtrace if C<$force> is trueish or if the log level +C is active. + +=item C + +Logs the message C<$message> if the log level C<$level> is active. The +message will be prefixed with a word describing the log level. + +=item C + +Equivalent to C. + +=item C + +Logs a message that the variable named C<$name> is dumped along with a +dump of the variable C<$variable> created by the L +module. Will log a warning if said module is not available. Will only +log if the log level C<$level> is active. + +=item C + +Logs a message that the variable named C<$name> is dumped along with a +dump of the variable C<$variable> created by the C module. Will +only log if the log level C<$level> is active. + +=item C + +Dumps the result of an SQL query in tabular form. Will only log if the +log level C<$level> is active. + +=item C + +Logs a unified diff of the textual representations of C<$item1> and +C<$item2>. Requires the module L and logs a warning if +said module is not available. + +C<$item1> and C<$item2> are dumped via L before diffing +if they're non-scalars. + +Will only log if the log level C<$level> is active. + +=item C + +=item C + +=item C + +=item C + +=item C + +Internal functions used to log the current request's exeuction time +(log level C). + +=item C + +Returns the current request's elapsed execution time in seconds. + +=item C + +Sets and/or returns the file name this instance logs to. + +=item C + +Returns if a log level C<$level> is active. C<$level> is a string +representation, not one of the level constants from above. + +If C<$val> is given then said level will be turned on (if C<$val> is +trueish) or off (if C<$val> is falsish). + +=back + +=head1 BUGS + +Nothing here yet. + +=head1 AUTHOR + +Moritz Bunkus Em.bunkus@linet-services.deE, +Sven Schöling Es.schoeling@linet-services.deE + +=cut -- 2.20.1