Log observer

From: Date: Wed, 18 Jul 2001 00:24:44 +0000
Subject: Log observer
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-855@lists.php.net to get a copy of this message
Now make me use ASP if I'm wrong but... I'm tinkering with the Log and observer classes in PEAR at the mo out of curiosity. The log code works fine. My basic example is: $l = Log::factory("file", "/tmp/graeme.log", "TEST"); $l->open(); $l->log("WO0T", LOG_INFO); $l->close(); Am I correct in the usage? Now I tried setting up an observer: $o = Log_observer::factory("file", LOG_ERR); But this returns FALSE even though the format is basically the same so I'd expect the implementation to be the same. So I changed it to: $o = new Log_observer(); $o = Log_observer::factory("file", LOG_ERR); However, it appears that you have to do $o = new Log_observer(LOG_ERR); $o = Log_observer::factory("file", LOG_ERR); because unless you set the priority twice, the priority sent through to Log::notifyAll remains at the value set by the constructor. Now lookking at the Log_oserver class I can see why that happens. Is it me or the code? If it is me (and it prob is) what's the correct way to do it? Cheers, Graeme

« previous php.pear.dev (#855) next »