The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

MooseX::ShortCut::BuildInstance::UnhideDebug - Unhides debug lines for Log::Shiras

DESCRIPTION

This package definitly falls in the dark magic catagory of perl and it is a source filter using Filter::Util::Call. Activiation (exposure) of debug lines will only slow your code down. Don't do it if you arn't willing to pay the price. The value of exposing those lines is all the interesting information you receive from the debugging code. To use this file you must install as a minimum Log::Shiras::Switchboard and Log::Shiras::Telephone from github in one of your module libraries. Yes that code is definitly in alpha state (at best).

The good news for anyone that is not interested in using this class is that none of the DEPENDENCIES are activated and none of the package debug lines are exposed to slow the code down unless the ':debug' flag is sent to Log::Shiras::Switchboard . Read that as it won't happen if you don't install and use Log::Shiras and the package will run just fine without installing it.

This class is a source filter with the single purpose of uhiding '###LogSD' (Shiras Debug) debug lines written in this package and activated by Log::Shiras . MooseX::ShortCut::BuildInstance is used by Log-Shiras internally and gets 'used' there so that the specific timing of any source filter implementation for this package must fall after the Switchboard ':debug'ing is set on or off and before any other classes can be called like Log::Shiras::UnhideDebug . The implementation of the delay in calling MooseX::ShortCut::BuildInstance within Log::Shiras till after a decision on debug implementation is accomplished with an eval EXPR line. The source filter is then needed immediatly so it cannot be implemented with a generic source filter like Log::Shiras::UnhideDebug. A class specific source filter is therefore needed to resolve that. The source filter here triggers off the environmental variable $ENV{log_shiras_filter_on} which is set when the ':debug' flag is passed to 'use Log::Shiras::Switchboard @args' in the @args. Since this package provides only a functional interface all the debug namespaces of the exposed functions are the names of the functions themselves. The namespaces in this package do not inherit pre-fixes from the consuming class. (Generally I write namespaces for object methods that do inherit pre-fixes from the parent class.)

For this class to work any call for 'use MooseX::ShortCut::BuildInstance' must occur after the call to 'use Log::Shiras::Switchboard qw( :debug );'. Otherwize the class will be loaded without the debug lines exposed.

SUPPORT

TODO

    1. Remove raw links to Log-Shiras files in the github repo when Log-Shiras is published to CPAN

    2. Write a test suit for this class - pending release of Log-Shiras to CPAN (also skip the test if Log::Shiras is not installed)

AUTHOR

Jed Lund
jandrew@cpan.org

COPYRIGHT

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

This software is copyrighted (c) 2012 and 2015 by Jed Lund

DEPENDENCIES