How to know wheter a message will be logged or not
| From: | Zak Mc Kracken | Date: | Thu, 02 Oct 2003 16:56:51 +0000 |
| Subject: | How to know wheter a message will be logged or not | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-164755@lists.php.net to get a copy of this message | ||
Hi all,
I'm using syslog() function to log messages. My problem is enough
typical. An example:
syslog ( LOG_DEBUG, "The function output is: " . very_slow_func () );
Since very_slow_func() is, as written, very slow, I would like to know
in advance if this message will be actually logged or not, so that I
could write:
if ( is_logged ( LOG_DEBUG ) )
syslog ( LOG_DEBUG, "The function output is: " . very_slow_func () );
I cannot find in PHP some is_logged() equivalent.
Any help?
Thanks.
Marco Brandizi