[dev] Golem logger

Ben Klang ben at alkaloid.net
Mon May 14 16:13:27 UTC 2007


On Monday 14 May 2007 10:05:16 am Michael Rubinsky wrote:
> Quoting Ben Klang <ben at alkaloid.net>:
> > On Monday 14 May 2007 03:06:16 am Duck wrote:
> >> The recent update of Gollem.php Version 1.208 makes Gollem unusable, if
> >> logging ins disabled. (The result fo Horde::getLogger is false)
> >
> > After grepping through the Horde (and a few modules') sources, I can
> > only find
> > one good example of getLogger(), which is the one I used to model the
> > commit to Gollem.  Further the phpdoc on getLogger() is missing.
> >
> > I can modify gollem/lib/Gollem.php to check for a return type === false. 
> > Is that typically how Horde signifies logging being disabled?  I would
> > like to distinguish between disabled logging and an error instantiating
> > the logging.
>
> No. Look at how both Horde::getLogger() is implemented as well as
> VFS::setLogger and VFS::log().  You don't technically need to even
> check your return value, as VFS::setLogger will check the $logger
> parameter for you...and VFS::log() checks for the existence of the
> logger before attempting to log....
I did look at the sources, and this was part of the reason I asked.  Before I 
committed a fix, I wanted the community's input on the best implementation.

Thanks for the feedback.  I'll put something together for Gollem and update 
the phpdoc for the Horde::getLogger() method.

/BAK/
-- 
Ben Klang
Alkaloid Networks
ben at alkaloid.net
http://projects.alkaloid.net
404.475.4850


More information about the dev mailing list