The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Name

wddebug - enable or disable debugging within WebDyne modules

Synopsis

wddebug [OPTIONS] <FILE>

Options

-h, --help Show brief help message.

-m, --man

Show the manual page

--status

Show the current status of debugging within the module tree. This is the default if no options are given.

--enable

Enable debugging within the module tree

--disable

Disable debugging within the module tree.

--directory

Manually specify the directory where the module tree resides.

--yes

Bypass confirmation message

--version

Display cersion information.

A file name may be optionally specified to specifically enable or disable debugging for only one module.

Description

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 !

Usage

Enable global debugging:

wddebug --enable

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

Author

Written by Andrew Speer, andrew@webdyne.org

LICENSE and COPYRIGHT

This file is part of WebDyne.

This software is Copyright (c) 2017 by Andrew Speer <andrew@webdyne.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