Re: Re: cvs: pear /XML_Transformer Transformer.php package.xml /XML_Transformer/Transformer/Driver OutputBuffer.php
| From: | Alan Knowles | Date: | Tue, 09 Sep 2003 05:56:03 +0000 |
| Subject: | Re: Re: cvs: pear /XML_Transformer Transformer.php package.xml /XML_Transformer/Transformer/Driver OutputBuffer.php | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-21222@lists.php.net to get a copy of this message | ||
Sebastian Bergmann wrote:
Alan Knowles wrote:dataobjects old debug calls where pretty simlar $this->debug('message',$level); and the debug call did something like.. function debug($msg,$level=1) { if ($_GLOBALS['_DB_DATAOBJECT']['debug'] => $level) { .... print ...It's slightly better to do the if ($this->_debug) { $this->_debug(...); } check outside the debug method, as the overhead of the debug method calls can be quite high..I'm not sure I understand what you mean here. Yesterday's patch split the old _debug() method in two: _debugCheck() is now used to assert whether or not a debugging message should be triggered and _debug() sends it to right target.
}} but since it had to do the method call to debug, before printing anything out.. (and since it was called alot)... it appeared to be one of the slower parts of the application.. so I changed all the debug calls to: if ($_GLOBALS['_DB_DATAOBJECT']['debug']) { $this->debug('message',$level); } in theory it prevents quite a bit of C code/ allocating/swapping/passing memory etc... (and probably a few less opcodes) Regards Alan
-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.comBTW - any chance that the default debug level when on to just echo to the screen - it was a bit of a pigs ear to use, and I ended up just adding echo statements cause it was too complex..You could just use$t->setLogTarget('print');and _debug() messages will be printed. HTH, Sebastian