kosun has asked for the wisdom of the Perl Monks concerning the following question:
I'm want some very simple logging that given something like
prints the equivalent of doing this on the same linefile.pl 20: log_error( "a error msg", $level )
i.e. It prints the line number where the function was called, not the line number from inside the log_error subrountine.print STDERR "a error msg:" . __FILE__ . __LINE__ if $level >= THRESHOLD;
Stuck on how to do this
1. Printing the line number where the log_error was called without including it in the argument
2. I'd like anything < THRESHOLDfor the current run to be removed at compile time if possible to avoid a performance hit...not sure if can really do that...or if it makes a difference.
This application has to be very fast I don't need much and prefer to not use any log modules if I don't need to.
Any help appreciated thanks so much!
Kosun
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: fast logging showing calling position..
by ikegami (Patriarch) on Sep 01, 2005 at 17:51 UTC | |
|
Re: fast logging showing calling position..
by talexb (Chancellor) on Sep 01, 2005 at 19:20 UTC |