1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-24 18:16:10 +02:00

Fix constructor handling of arrays

This commit is contained in:
Jordi Boggiano
2011-02-17 03:16:20 +01:00
parent 2ff85ba472
commit 9d8c84d6cd
2 changed files with 8 additions and 2 deletions

View File

@@ -31,7 +31,13 @@ class Logger
public function __construct($logs = array())
{
$this->logs = (array) $logs;
$this->logs = array();
if (!is_array($logs)) {
$logs = array($logs);
}
foreach ($logs as $log) {
$this->logs[$log->getName()] = $log;
}
}
public function addLog(Log $log)