FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=16452&edit=1

ID: 16452
Comment by: pim@lemonbit.com
Reported By: pim at lemonbit dot com
Summary: Shortcut log methods log class name incorrectly
Status: Open
Type: Bug
Package: Log
Operating System: Mac OS X
Package Version: 1.11.4
PHP Version: 5.2.5
Roadmap Versions:
New Comment:

Please note: In contrary to the script example I have found this bug
using a composite handler!


Previous Comments:
------------------------------------------------------------------------

[2009-07-18 20:40:55] prupert

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)".

------------------------------------------------------------------------

Search Discussions

  • Jon at Jul 19, 2009 at 12:18 am
    Edit report at http://pear.php.net/bugs/bug.php?id=16452&edit=1

    ID: 16452
    Updated by: jon@php.net
    Reported By: pim at lemonbit dot com
    Summary: Shortcut log methods log class name incorrectly
    -Status: Open
    +Status: Assigned
    Type: Bug
    Package: Log
    Operating System: Mac OS X
    Package Version: 1.11.4
    PHP Version: 5.2.5
    -Assigned To:
    +Assigned To: jon
    Roadmap Versions:
    New Comment:

    -Status: Open
    +Status: Assigned
    -Assigned To:
    +Assigned To: jon



    Previous Comments:
    ------------------------------------------------------------------------

    [2009-07-18 20:44:27] prupert

    Please note: In contrary to the script example I have found this bug
    using a composite handler!

    ------------------------------------------------------------------------

    [2009-07-18 20:40:55] prupert

    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)".

    ------------------------------------------------------------------------
  • Jon at Jul 19, 2009 at 12:33 am
    Edit report at http://pear.php.net/bugs/bug.php?id=16452&edit=1

    ID: 16452
    Updated by: jon@php.net
    Reported By: pim at lemonbit dot com
    Summary: Shortcut log methods log class name incorrectly
    -Status: Assigned
    +Status: Closed
    Type: Bug
    Package: Log
    Operating System: Mac OS X
    Package Version: 1.11.4
    PHP Version: 5.2.5
    Assigned To: jon
    Roadmap Versions:
    New Comment:

    -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.




    Previous Comments:
    ------------------------------------------------------------------------

    [2009-07-19 02:15:56] jon

    -Status: Open
    +Status: Assigned
    -Assigned To:
    +Assigned To: jon


    ------------------------------------------------------------------------

    [2009-07-18 20:44:27] prupert

    Please note: In contrary to the script example I have found this bug
    using a composite handler!

    ------------------------------------------------------------------------

    [2009-07-18 20:40:55] prupert

    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)".

    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJul 18, '09 at 6:47p
activeJul 19, '09 at 12:33a
posts3
users2
websitepear.php.net

2 users in discussion

Jon: 2 posts Pim: 1 post

People

Translate

site design / logo © 2022 Grokbase