dtRdr::Logger - global logging
use dtRdr::Logger; L->debug($message, ...); L->info($message, ...); L->warn($message, ...); L->error($message, ...); L->fatal($message, ...);
For a stacktrace:
sub bar { L()->logcluck("foo"); }
See Log::Log4perl for more info.
This (currently) installs a $SIG{__WARN__}, though we'll probably try to move away from that.
dtRdr::Logger->import(@args);
A shortcut to return a logger object FOR YOUR NAMESPACE with an optional list of subtags.
L($subtag);
Example:
package My::Package; my $logger = L; my $logger = L('#foo');
Now $logger will log into the class 'log4perl.logger.My.Package.#foo'.
$subtag MUST start with a #. If this is omitted, it will be changed.
A shortcut to a root-level logger.
RL($tag); my $logger = RL('#foo');
Now $logger which will log into the class 'log4perl.logger.#foo'.
$tag MUST start with a #. If this is omitted, it will be changed.
Launches $ENV{THOUT_EDITOR} with a tempfile containing $string.
Just a handy way to get some debugging data into an editor.
dtRdr::Logger->editor($string);
Or, to do lazy evaluation only when needed, pass a sub that returns a string.
dtRdr::Logger->editor(sub {do_stuff_that_takes_time()});
Similar to editor, but writes to a tempfile in "/tmp/$filename".
DBG_DUMP($ENV_NAME, $filename, sub {$content});
Only acts if $ENV{"DBG_$ENV_NAME"} is set.
DBG_FOO=1 ./Build test
...will cause this
DBG_DUMP('foo', 'thisfile.txt', sub {$blah});
...to write the content of $blah to '/tmp/thisfile.txt'.
The sub {$thing} thing is a speed hack, but that variable is big enough to make you want to open it in an editor, so...
dtRdr::Logger->init(filename => "foo");
Eric Wilhelm <ewilhelm at cpan dot org>
http://scratchcomputing.com/
Copyright (C) 2006 Eric L. Wilhelm and OSoft, All Rights Reserved.
Absolutely, positively NO WARRANTY, neither express or implied, is offered with this software. You use this software at your own risk. In case of loss, no person or entity owes you anything whatsoever. You have been warned.
The dotReader(TM) is OSI Certified Open Source Software licensed under the GNU General Public License (GPL) Version 2, June 1991. Non-encrypted and encrypted packages are usable in connection with the dotReader(TM). The ability to create, edit, or otherwise modify content of such encrypted packages is self-contained within the packages, and NOT provided by the dotReader(TM), and is addressed in a separate commercial license.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
To install dtRdr, copy and paste the appropriate command in to your terminal.
cpanm
cpanm dtRdr
CPAN shell
perl -MCPAN -e shell install dtRdr
For more information on module installation, please visit the detailed CPAN module installation guide.