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

NAME

Debug::Xray - Debugging tool to trace, log, and watch variables

VERSION

Version 0.05

SYNOPSIS

Debug::Xray allows you to easily instrument your code and log what happens. If you log subroutines, logging messages will be suitably indented.

    use Debug::Xray;

    my $watcher = Debug::Xray::watch_all_subs();
    my $var;
    add_watch_var($var);

EXPORT

# SIGNAL HANDLING &debug_warn_handling &default_warn_handling &debug_error_handling &default_error_handling

# LOGGING &start_sub &end_sub &dprint &set_debug_verbose &set_debug_quiet

# WATCH ROUTINES &add_watch_var &watch_subs &watch_all_subs

# TESTING OF THIS MODULE &is_carp_debug

SUBROUTINES

debug_warn_handling()

The debug_warn_handling subroutine causes the debugging warning processing to come into effect. Warnings will be logged. Logging is written to standard input and optionally to a file.

default_warn_handling()

The default_warn_handling subroutine causes the standard warning processing to come into effect.

debug_error_handling()

The debug_error_handling subroutine causes the debugging error processing to come into effect. Hopefully, all errors are logged. Logging is written to standard input and optionally to a file.

default_error_handling()

The default_error_handling subroutine causes the standard error processing to come into effect.

start_sub()

The start_sub subroutine logs the start of a subroutine. You may insert this at the start of a subroutine or have it done automatically via the watch methods. Logging is written to standard input and optionally to a file.

end_sub()

The end_sub subroutine logs the end of a subroutine. You may insert this at the end of a subroutine or have it done automatically via the watch methods. Logging is written to standard input and optionally to a file.

dprint($mesg)

The dprint subroutine logs whatever you pass to it. Currently, it takes a single scalar, so if you need to concatenate with '.' rather than ','. Logging is written to standard input and optionally to a file.

set_debug_verbose()

The set_debug_verbose subroutine causes logging to be written to standard input and optionally to a file.

set_debug_quiet()

The set_debug_quiet subroutine turns off all debug logging.

add_watch_var($var)

The add_watch_var subroutine causes logging of all changes or access to the variable being watched.

watch_subs( subroutine list )

The watch_subs subroutine causes logging of entries to and exits from subroutines passed in. The subroutines may be quoted.

watch_all_subs()

The watch_all_subs subroutine causes logging of entries to and exits from all subroutines in the scope of the call.

is_carp_debug()

The is_carp_debug subroutine is for debugging purposes.

NOTE: The log file is active if it is hard-coded at the top of this module. This will be fixed.

AUTHOR

Dave Carvell, <dave_carvell at yahoo.com>

BUGS

Please report any bugs or feature requests to bug-debug-xray at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Debug-Xray. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Debug::Xray

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2011 Dave Carvell.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.