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 > Libraries

    Log::Dispatch::Atom 0.03

    Download button

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

    License / Price:

    Last Updated:

    Category:
    Dominic Mitchell | More programs
    Perl Artistic License / FREE
    February 9th, 2007, 13:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Log::Dispatch::Atom description

    Log::Dispatch::Atom is a Perl module to log to an atom feed.

    Log::Dispatch::Atom is a Perl module to log to an atom feed.

    SYNOPSIS

    use Log::Dispatch::Atom;

    my $log = Log::Dispatch::Atom->new(
    name => 'foo',
    min_level => 'debug',
    file => 'file.atom'
    );
    $log->log_message( level => 'error', message => 'A problem happened' );
    $log->log_message( level => 'debug', message => 'Got Here' );

    This class implements logging backed by an Atom feed so that you can subscribe to the errors produced by your application.

    You should not use this object directly, but should manage it via a Log::Dispatch object.

    IMPLEMENTATION NOTES

    In order to safely write to the log file, the entire file must be locked each time that an entry is logged. This probably makes it unsuitable for high volume log files.
    The log file is opened and closed on each call to log_message().

    METHODS

    new()

    Takes a hash of arguments. Returns a new Log::Dispatch::Atom object. The following parameters are used:

    name [mandatory]

    The name of the logging object.

    min_level [mandatory]

    The minimum logging level this object will accept. See Log::Dispatch for more information.

    max_level [optional]

    The maximum logging level this object will accept. See Log::Dispatch for more information. The default is the highest possible level (ie: no maximum).

    file [mandatory]

    Specifies the location of the file to read/write the feed from.

    feed_id [optional]

    Specifies the identity of the feed itself. Normally, this should be set to the published URI of the feed.
    If not specified, it will be omitted, which is in violation of the Atom specification. For more information, see http://www.atomenabled.org/developers/syndication/#requiredFeedElements.

    feed_title [optional]

    The title of the feed. This should probably be set to the name of your application.

    If not specified, it will be omitted, which is in violation of the Atom specification. For more information, see http://www.atomenabled.org/developers/syndication/#requiredFeedElements.
    XXX This should probably just use the name parameter. What do you think? Let me know.

    feed_author [optional]

    The author details of a feed. This is specified as a hash reference, which must contain one or more of the three keys name, email and uri.

    In order to create a valid Atom feed, you must either supply an author in every single entry (log message), or ensure that the feed itself has an author. The latter is probably the easier solution, so I recommend this parameter be supplied.

    NB: The feed_* parameters will only be used when a new feed is being created. If you are creating a new object for an existing feed, they will be ignored.

    log_message()

    Takes a hash of arguments. Has no return value. The following parameters are used.

    message [mandatory]

    The actual log message.

    level [mandatory]

    The level of the message. See Log::Dispatch for a full list.

    id [optional]

    Each entry requires an id in order for the feed as a whole to be a valid Atom document. It's used by readers of Atom documents to determine whether or not an entry has been seen previously.

    If not specified, this will default to an URL comprising the current time plus the pid plus the hostname plus a monotonically increasing integer. eg: tag:fred.example.com,2005-12-07:1133946771/20827/2. This should be good enough for a uniqueness test.

    author [optional]

    You can specify author details for an individual entry if desired. The author parameter is expected to be a hash reference, which must contain one or more of the keys name, email or uri.

    Product's homepage

      


    TAGS:

    atom feed | log feed | Perl module | Log::Dispatch::Atom | log | atom

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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