Log::Contextual

Simple logging interface with a contextual log
Download

Log::Contextual Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Arthur Axel Schmidt
  • Publisher web site:
  • http://search.cpan.org/~frew/

Log::Contextual Tags


Log::Contextual Description

Log::Contextual is a simple Perl interface to extensible logging. It is bundled with a really basic logger, Log::Contextual::SimpleLogger, but in general you should use a real logger instead of that. For something more serious but not overly complicated, try Log::Dispatchouli (see "SYNOPSIS" for example.)The reason for this module is to abstract your logging interface so that logging is as painless as possible, while still allowing you to switch from one logger to another.SYNOPSIS use Log::Contextual qw( :log :dlog set_logger with_logger ); use Log::Contextual::SimpleLogger; use Log::Log4perl ':easy'; Log::Log4perl->easy_init($DEBUG); my $logger = Log::Log4perl->get_logger; set_logger $logger; log_debug { 'program started' }; sub foo { with_logger(Log::Contextual::SimpleLogger->new({ levels => }) => sub { log_trace { 'foo entered' }; my ($foo, $bar) = Dlog_trace { "params for foo: $_" } @_; # ... log_trace { 'foo left' }; }); } foo();Beginning with version 1.008 Log::Dispatchouli also works out of the box with Log::Contextual: use Log::Contextual qw( :log :dlog set_logger ); use Log::Dispatchouli; my $ld = Log::Dispatchouli->new({ ident => 'slrtbrfst', to_stderr => 1, debug => 1, }); set_logger $ld; log_debug { 'program started' };Product's homepage


Log::Contextual Related Software