dtRdr::Logger

dtRdr::Logger is a Perl module for global logging.
Download

dtRdr::Logger Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Eric Wilhelm
  • Publisher web site:
  • http://search.cpan.org/~ewilhelm/dotReader-v0.11.2/lib/MultiTask/Minion.pm

dtRdr::Logger Tags


dtRdr::Logger Description

dtRdr::Logger is a Perl module for global logging. dtRdr::Logger is a Perl module for global logging.SYNOPSIS 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.ABOUTThis (currently) installs a $SIG{__WARN__}, though we'll probably try to move away from that.import dtRdr::Logger->import(@args);Get LoggerLA 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.RLA 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.editorLaunches $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()});DBG_DUMPSimilar 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...init dtRdr::Logger->init(filename => "foo"); Requirements: · Perl


dtRdr::Logger Related Software