Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.14.4

Bug #16452 Shortcut log methods log class name incorrectly
Submitted: 2009-07-19 00:40 UTC
From: prupert Assigned: jon
Status: Closed Package: Log (version 1.11.4)
PHP Version: 5.2.5 OS: Mac OS X
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 30 + 45 = ?

 
 [2009-07-19 00:40 UTC] prupert (Pim Rupert)
Description: ------------ the shortcut methods to log an event (such as debug(), info(), alert()) don't log the correct class name where the event occured. In stead, they log their 'self' class name "Log". The name of the function/method however does get logged correctly. Test script: --------------- class MyClass { function myFunction { /* Start a log instance with the class name displayed */ $options = array('lineFormat' => '%4$s (%8$s::%7$s)'); $logger = &Log::singleton('display', '', '', $options); /* Log an event using log() */ $logger->log('This will be logged correctly with the class name MyClass in the log event details.'); /* Log an event using the shortcut info() */ $logger->info('This will be logged incorrectly, MyClass is not logged as the class name!'); } } Expected result: ---------------- The output using '%4$s (%8$s::%7$s)' as the lineFormat should be "Message (MyClass::myFunction)". Actual result: -------------- The actual output using info() (or any other shortcut log method) is incorrect: "Message (Log::myFunction)".

Comments

 [2009-07-19 00:44 UTC] prupert (Pim Rupert)
Please note: In contrary to the script example I have found this bug using a composite handler!
 [2009-07-19 06:15 UTC] jon (Jon Parise)
-Status: Open +Status: Assigned -Assigned To: +Assigned To: jon
 [2009-07-19 06:31 UTC] jon (Jon Parise)
-Status: Assigned +Status: Closed
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.