[Chameleon-dev] [Bug 1130] New: [Logger] log() unneccesarily dependent on $gLogFile and ob_start

bugzilla-daemon at bugzilla.maptools.org bugzilla-daemon at bugzilla.maptools.org
Mon Aug 22 04:49:14 EDT 2005


http://bugzilla.maptools.org/show_bug.cgi?id=1130

           Summary: [Logger] log() unneccesarily dependent on $gLogFile and
                    ob_start
           Product: Chameleon
           Version: 2.2
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: chameleon-dev at lists.maptools.org
        ReportedBy: uzde083 at syncera.nl


* The method log() withing Logger uses the global $gLogFile variable to log to.
This should be the attribute $this->oLogFile. 
* It's not necessary to use ob_start, etc. Just use var_export
* The global declarations are unneccessary

Extra suggestion: why not also output object contents to log, just like one
already can with arrays?

See inline patch for code suggestion.

Regards, Roald

231d230
<         global $gLogFile, $gErrorManager;
235c234
<         if ( !isset($gLogFile) || $nLevel < 1 )
---
>         if ( !isset($this->oLogFile) || $nLevel < 1 )
241,246c240
<         {
<             ob_start();
<             print_r( $mMessage );
<             $szMessage = "Array Contents:\n".ob_get_contents();
<             ob_end_clean();
<         }
---
>             $szMessage = "Array Contents:\n". var_export($mMessage, true);
254c248
<         $gLogFile->logMessage($nLevel, $szMessage);
---
>         $this->oLogFile->logMessage($nLevel, $szMessage);



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


Please do NOT reply to this email, use the link above instead to 
login to bugzilla and submit your comment. Any email reply to this
address will be lost.


More information about the Chameleon-dev mailing list