Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Perl Modules

    MojoX::Log::Dispatch 0.1

    Download button

    No screenshots available
    Downloads: 306  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Konstantin Kapitanov | More programs
    Perl Artistic License / FREE
    February 2nd, 2012, 20:03 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    MojoX::Log::Dispatch description

    Log::Dispatch For Mojo

    MojoX::Log::Dispatch is a Perl wrapper around Log::Dispatch module. Log::Dispatch manages a set of Log::Dispatch::* objects, allowing you to add and remove output objects as desired.

    Include log statements at various levels throughout your code. Then when you create the new logging object, set the minimum log level you want to keep track off. Set it low, to 'debug' for development, then higher in production.

    SYNOPSIS

     use MojoX::Log::Dispatch;

     # Create a Log::Dispatch whith logging object that will log to STDERR by default
     # or to file if exists attribute path
     
     my $log = MojoX::Log::Dispatch->new();

     $log->add(Log::Dispatch::File->new(name => 'file1',
     min_level => $self->level,
     filename => 'logfile'
     ));
     
     #Add some exotic loggers
     $log->add(Log::Dispatch::Twitter->new( username => "foo",
     password => "bar",
     min_level => "critical",
     name => "twitter",
     ));
     
     #and now as in Mojo::Log

     $log->debug("Why isn't this working?");
     $log->info("FYI: it happened again");
     $log->warn("This might be a problem");
     $log->error("Garden variety error");
     $log->fatal("Boom!");
     $log->emergency("Boom! Boom!");
     $log->alert("Hello!");
     $log->critical("This might be a BIG problem");
     $log->warning("This might be a problem");#=warn
     $log->notice("it happened again");
     
     #OR:
     $log->log('debug' => 'This should work');
     
     
     #In your Mojo App
     # create a custom logger object for Mojo/Mojolicious to use
     # (this is usually done inside the "startup" sub on Mojolicious).
     
     use MojoX::Log::Dispatch;
     use Log::Dispatch::Syslog;
     
     my $dispatch = MojoX::Log::Dispatch->new('path' => '/home/green/tmp/mySupEr.log',
     'remove_default_log_obj' => 0);
     
     $dispatch->add(Log::Dispatch::Syslog->new( name => 'logsys',
     min_level => 'debug',
     ident => 'MyMojo::App',
     facility => 'local0' )
     );
     $self->log($dispatch);
     
     #and then
     $self->log->debug("Why isn't this working?");



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    Mojo Log::Dispatch | Perl module | Mojo | log | dispatch

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM