Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: fast logging showing calling position..

by ikegami (Patriarch)
on Sep 01, 2005 at 17:51 UTC ( [id://488440]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Carp ();
    
    sub log_error {
       goto(&Carp::carp) if pop(@_) >= THRESHOLD;
    }
    
  2. or download this
    sub DEBUG     () { 0 }
    sub FATAL     () { 4 }
    ...
    sub THRESHOLD () { 0 }
    
    log_error($msg) if FATAL >= THRESHOLD;
    
  3. or download this
    use Carp ();
    
    ...
    log_error($msg) if DEBUG;  # Whole statement removed at compile time.
    log_error($msg, WARN);     # Calls log_error, but not carp.
    log_error($msg, FATAL);    # Calls log_error and carp.
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-25 15:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found