wddebug - enable or disable debugging within WebDyne modules
wddebug [OPTIONS] <FILE>
-h, --help Show brief help message.
- -m, --man
Show the manual page
Show the current status of debugging within the module tree. This is the default if no options are given.
Enable debugging within the module tree
Disable debugging within the module tree.
Manually specify the directory where the module tree resides.
Bypass confirmation message
Display cersion information.
A file name may be optionally specified to specifically enable or disable debugging for only one module.
The wddebug(1) command will enable or disable debugging within the WebDyne suite of modules.
wddebug acts by editing the content of the WebDyne modules to enable or disable debugging routines. Debugging is controlled this way (rather than at runtime) to ensure that WebDyne modules run at the fastest possible speed when debugging is disabled.
When disabled debugging statements within each module are prefixed with the command "0 &&" (as in: 0 && debug "xyz"), which are optimised away at runtime by the Perl bytecode compiler.
When debugging is enabled the "0 &&" is replaced by "1 &&" to ensure that the debug statements are called at run-time.
Enabling and disabling debugging in this way is generally considered bad practice - for this reason this utility should only be used in an isolated test or development environment. The routine will modify all modules in the WebDyne directoy and below, and may have undesired (or unintended) consquence on any module that resides in those directories.
For this reason the wddebug utility should be used with extreme care !
Enable global debugging:
Or for just one module
wddebug --enable WebDyne/Session.pm
Debug output can then be displayed by setting the WEBDYNE_DEBUG environment variable.
WEBDYNE_DEBUG=1 wdrender test.psp
Will display debug output when rendering a test page. You can filter down to one module by setting the environment variable to the method/subroutine you are interested in:
WEBDYNE_DEBUG=WebDyne::handler wdrender test.psp
Will only show debug information from the WebDyne::handler method.
Debug information can be saved to a file by setting the WEBDYNE_DEBUG_FILE environment variable:
WEBDYNE_DEBUG_FILE=/tmp/webdyne.log wdrender test.psp
If you require file output to be filtered you can combine the two environment variables
WEBDYNE_DEBUG_FILE=/tmp/webdyne.log WEBDYNE_DEBUG=WebDyne::handler wdrender test.psp
Written by Andrew Speer, email@example.com
This file is part of WebDyne.
This software is Copyright (c) 2016 by Andrew Speer <firstname.lastname@example.org>.
This is free software, licensed under:
The GNU General Public License, Version 2, June 1991
Full license text is available at: http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt