Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Using STDERR and timestamps to write to a log file

by Booger (Pilgrim)
on Apr 27, 2005 at 17:30 UTC ( #452039=note: print w/ replies, xml ) Need Help??


in reply to Using STDERR and timestamps to write to a log file

Yet another example for you... (not that you need another, though)

I do the following for one of my mod_perl apps in which I use warn to output debugging & status information to Apaches error_log:

$SIG{__WARN__} = sub { $msg = undef; foreach (@_) { $msg =~ s/ at.*$// unless $msg =~ /(uninit|deprec)/; } print STDERR 'MyApp...' . $msg; }
Where I really only want to see the line number if it's an uninitialized or deprecated warning message. One could very easily add a timestamp to this, too.


Comment on Re: Using STDERR and timestamps to write to a log file
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://452039]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2015-07-04 05:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls