mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-03 11:47:38 +02:00
Fix constructor handling of arrays
This commit is contained in:
@@ -23,7 +23,7 @@ class Log
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->level = $level;
|
||||
$this->writers = (array) $writers;
|
||||
$this->writers = is_array($writers) ? $writers : array($writers);
|
||||
}
|
||||
|
||||
public function getName()
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user