Removed redundant type check in Logger::forcedLog().
The same check is made in LoggerLoggingEvent constructor. The Exception type hint for $throwable was removed from the constructor to prevent errors if a non-exception is given here. Any non-exceptions will just be ignored anyway.
git-svn-id: https://svn.apache.org/repos/asf/logging/log4php/trunk@1379728 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/php/Logger.php b/src/main/php/Logger.php
index 151c67e..08e6704 100644
--- a/src/main/php/Logger.php
+++ b/src/main/php/Logger.php
@@ -202,9 +202,6 @@
* @param mixed $message message to log
*/
public function forcedLog($fqcn, $throwable, LoggerLevel $level, $message) {
- if (!($throwable instanceof Exception)) {
- $throwable = null;
- }
$this->callAppenders(new LoggerLoggingEvent($fqcn, $this, $level, $message, null, $throwable));
}
diff --git a/src/main/php/LoggerLoggingEvent.php b/src/main/php/LoggerLoggingEvent.php
index 02ba447..f286089 100644
--- a/src/main/php/LoggerLoggingEvent.php
+++ b/src/main/php/LoggerLoggingEvent.php
@@ -117,7 +117,7 @@
* @param integer $timeStamp the timestamp of this logging event.
* @param Exception $throwable The throwable associated with logging event
*/
- public function __construct($fqcn, $logger, $priority, $message, $timeStamp = null, Exception $throwable = null) {
+ public function __construct($fqcn, $logger, $priority, $message, $timeStamp = null, $throwable = null) {
$this->fqcn = $fqcn;
if($logger instanceof Logger) {
$this->logger = $logger;