Skip to content

Commit

Permalink
Fix handling when no logger is desired.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Feb 20, 2017
1 parent 699143e commit e714d28
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions framework/ActiveSync/lib/Horde/ActiveSync/Log/Factory.php
Expand Up @@ -42,9 +42,6 @@ class Horde_ActiveSync_Log_Factory implements Horde_ActiveSync_Interface_LoggerF
*/
public function __construct(array $params)
{
if (empty($params['type']) || empty($params['path'])) {
throw new InvalidArgumentException('Missing required parameters.');
}
if (empty($params['level'])) {
$params['level'] = 'META';
}
Expand All @@ -65,6 +62,10 @@ public function create($properties = array())
$stream = $logger = false;
$formatter = new Horde_ActiveSync_Log_Formatter();

if (empty($params['path'])) {
new Horde_ActiveSync_Log_Logger(new Horde_Log_Handler_Null());
}

switch ($this->_params['type']) {
case 'onefile':
if (!empty($properties['DeviceId'])) {
Expand Down Expand Up @@ -106,7 +107,7 @@ public function create($properties = array())
}

if (!$logger) {
$logger = new Horde_Log_Logger(new Horde_Log_Handler_Null());
$logger = new Horde_ActiveSync_Log_Logger(new Horde_Log_Handler_Null());
}

return $logger;
Expand Down

0 comments on commit e714d28

Please sign in to comment.