Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Log::Localized 0.05

    Download button

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

    License / Price:

    Last Updated:

    Category:
    Erwan Lemonnier | More programs
    Perl Artistic License / FREE
    January 24th, 2007, 06:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Log::Localized description

    Log::Localized is a Perl module to localize your logging.

    Log::Localized is a Perl module to localize your logging.

    SYNOPSIS

    What you most probably want to do is something like:
    package Foo;
    use Log::Localized;

    sub bar {
    # this message will be displayed if method bar's verbosity is >= 1
    llog(1,"running bar()");
    }

    # this message will be displayed if package Foo's verbosity is >= 3
    llog(3,"loaded package Foo");
    Then paste the following local verbosity rules in a file called 'verbosity.conf', in the same directory as your program:
    # log everything from wherever inside Foo and its subclasses, up to level 3
    Foo:: = 3
    # except for function Foo::foo who shall have verbosity 0
    Foo::bar = 0

    SYNOPSIS - ADVANCED

    In a program accepting command line arguments, you may want to do:
    use Getopt::Long;
    use Log::Localized log => 1;

    GetOptions("verbose|v+" => sub { $Log::Localized::VERBOSITY++; } );

    llog(1,"you used -v");
    llog(2,"you used -v -v");
    You may alter local verbosity from within the running code:
    package Foo;
    use Log::Localized log => 1;

    # verbosity level is 0 by default

    {
    # set verbosity locally in this block
    local $Log::Debug::VERBOSITY = 5;
    llog(5,"this will be logged");
    }

    debug(5,"but this won't");
    If you want to import 'llog' under another name in the calling module:
    package Foo;
    use Log::Localized rename => "my_log";

    # call Log::Localized::llog()
    my_log(1,"renamed llog()");
    See the examples directory in the module distribution for more real life examples.

    Log::Localized provides you with an interface for defining dynamically exactly which part of your code should log messages and with which verbosity.

    Log::Localized addresses one issue of traditional logging: in very large systems, a slight increase in logging verbosity usually generates insane amounts of logs. Hence the need of being able to turn on verbosity selectively in some areas of code only, in a localized way.

    Log::Localized is based on the concept of local verbosity. Each package and each function in a package has its own local verbosity, set to 0 by default. With Log::Localized you can change the local verbosity in just a function, just a package or just a class hierarchy via a so called verbosity rule. Verbosity rules are passed to Log::Localized either via a configuration file or via an import parameter. By changing verbosity rules according to the needs of the moment, you can alter your program's logging flow in a very fine-grained way, and get logs from only the code areas you are interested in.

    Log::Localized comes with default settings that make it usable 'out of the box', but its configuration options will let you redefine pretty much everything in its behavior.
    The actual logging in Log::Localized is handled by Log::Dispatch.

    Requirements:

    · Perl



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    localize logging | module localization | Perl module | Log::Localized | localize | logging

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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