Hi!
Would you be so kind as to create the following entry:
Name DSLI Description Info
----------- ---- -------------------------------------------- -----
Log::Agent ---- A general logging framework RAM
::Logger cdpr Application-level logging interface RAM
Read on if you're curious about what's going to be in there.
-------------------------
The Log::Agent::Logger will simply hold extensions to the Log::Agent
module that are not distributed along with Log::Agent because they
rely on external modules (same reasons that pushed me to releae
Log::Agent::Rotate as a separate module).
Whilst Log::Agent tackles the standard logwarn/logerr/logdie/logcarp
interface, Log::Agent::Logger will offer an API like this:
# Channel is a Log::Agent::Channel object (as introduced by
# forthcoming Log::Agent 0.2).
my $log = Log::Agent::Loger->make(
-channel => $channel,
-max_prio => 'info',
-min_prio => 'emerg',
);
$log->warn("This is a warning: %m");
$log->error("Can't open '%s': $!", $file);
$log->debug(sub { # construct log }, @some_sub_params);
The latest form will have its CODE ref called only when within the
min/max bounds.
Log::Agent::Logger capitalizes on the re-engineering of Log::Agent 0.2
which distinguishes between logwarn/logerr etc... mappings within a
logging driver, and channels, which are objects with a ->write()
routine that emits the formatted string.
Log::Agent 0.2 will come with 3 standard channels: File, Handle and Syslog.
Log::Agent::Logger will introduce more channels, and a subclass
Log::Agent::Dispatcher which will be a Log::Agent::Logger, plus will
hold a list of Log::Agent::Logger objects to which log messages will be
forwarded.
An application will therefore be able to use Log::Agent::Logger for its
own customized logging, without committing on the final destination of
the messages, and without needing to know at all.
Just like re-usable modules can use Log::Agent's logwarn() and logdie()
routines without knowing whether those will be remapped to warn() and die(),
or redirected to syslogd (with a final die, if logdie is used).
Raphael