All the Logger logging functions take two arguments (quoting phpdoc):
 * @param mixed $message message
 * @param mixed $caller caller object or caller string id

Now, call me crazy, but I just don't understand what $caller is used for.

First, it is propagated to forcedLog() method where it is ignored, unless it is an Exception (Logger.php:285). If it is an Exception then it is propagated into the LoggerLoggingEvent object (Logger.php:287) and ends up in LoggerLoggingEvent->throwableInfo (LoggerLoggingEvent.php:153). From there, I can't find it being accessed almost anywhere (only in one test: LoggerLoggingEventTest.php:44).

To me, this looks like something that was left over from some previous functionality. Maybe you know something more?

Since $caller appears in the most exposed methods in the whole project, I think we should either rewrite the docs to reflect the actuall functionality, or remove it from the methods if it has no use.

Regards,
Ivan

P.S. Finally a couple of days peace so I can put in a few hours on log4php. Gotta love Christmas. :D

Reply via email to