princepawn has asked for the wisdom of the Perl Monks concerning the following question:

I want to instrument my module with loglevel type functionality. Here is what I want:

Thanks! (to the monestary and all answerers of the questions)

Title edit by tye

Replies are listed 'Best First'.
Re: looking for a
by derby (Abbot) on Mar 22, 2002 at 14:06 UTC
Re: looking for a
by bluto (Curate) on Mar 22, 2002 at 17:32 UTC
    You'll have to install it, but Log::Dispatch will do this, and much more if you need it to. It's kind of like syslog in that one log statement can send info to one or more destinations, each customizable by the log level. I find this invaluable when I want to write lots of debug information to a log file and at the same time send less information to STDERR and even less to an email -- without using 3 different print statements.

    Speaking of syslog, I've never used Sys::Syslog, which comes with perl. I have no idea if/how to send stuff to stderr with it though. Different systems support different syslog features so yours might allow it. It's probably not worth the effort of setting it up though, esp if you want portable code.

    bluto