Re: PEAR Log mechanism
| From: | Chuck Hagenbuch | Date: | Sat, 01 Dec 2001 22:19:05 +0000 |
| Subject: | Re: PEAR Log mechanism | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-569@lists.php.net to get a copy of this message | ||
Quoting Vince Veselosky <vince@control-escape.com>:
> I'm just getting started with PEAR development. Can someone point me to some
> concrete code that shows how to use the Log class? I want to set up a
> filtering log something like syslog, so that only messages with the
> configured priority or higher actually get written and the rest are
> discarded. I've looked at the source, and I just can't get my mind around
> how to use these classes to implement such a thing. Obviously its doable and
> most likely been done, so I'm hoping someone can point me to an example
> implementation.
Right now there isn't a built-in way to do that. You can have an observer class
which does it, but that's a little roundabout. I use a wrapper function in my
code, which checks the priority before calling $logger->log(), but it should
probably be added at some point.
-chuck
--
Charles Hagenbuch, <chuck@horde.org>
"What was and what may be, lie, like children whose faces we cannot see, in the
arms of silence. All we ever have is here, now." - Ursula K. Le Guin