Jon Portnoy > IRC-Indexer-0.06 > IRC::Indexer::Logger

Download:
IRC-Indexer-0.06.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

IRC::Indexer::Logger - Simple interface to Log::Handler

SYNOPSIS ^

  my $handler = IRC::Indexer::Logger->new(
    ## Path to output file:
    LogFile  => $logfile_path,

    ## Typically 'debug', 'info', 'warn':
    LogLevel => 'info',
    
    ## Enable DevNull to set up loggers yourself later
    ## (Useful for only logging to STDOUT for example)
    DevNull => 0,
  );

  ## Switch to a different file:
  $handler->log_to($new_logfile);
  
  ## Access the actual logger:
  my $logger = $handler->logger;
  
  ## Log things:
  $logger->info("Something informative");
  $logger->warn("Something went wrong!");
  $logger->debug("Things are happening.");

DESCRIPTION ^

Simplified construction of Log::Handler instances for IRC::Indexer frontends.

See the SYNOPSIS for usage details and Log::Handler for more about using the log object itself.

AUTHOR ^

Jon Portnoy <avenj@cobaltirc.org>

syntax highlighting: