Skip to content

Commit

Permalink
This is MUCH easier to read.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Mar 1, 2017
1 parent da80f18 commit ff99b8a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions framework/ActiveSync/lib/Horde/ActiveSync/Log/Formatter.php
Expand Up @@ -27,6 +27,12 @@ class Horde_ActiveSync_Log_Formatter implements Horde_Log_Formatter
*/
protected $_format = '[%pid%] %levelName%: %indent%';

protected $_levelMap = array(
'CLIENT' => 'I',
'SERVER' => 'O',
'META' => '>>>'
);

/**
* Formats an event to be written by the handler.
*
Expand All @@ -43,6 +49,9 @@ public function format($event)
} else {
$event['indent'] = str_repeat(' ', $event['indent']);
}
$event['levelName'] = !empty($this->_levelMap[$event['levelName']])
? $this->_levelMap[$event['levelName']]
: $event['levelName'];
foreach ($event as $name => $value) {
$output = str_replace("%$name%", $value, $output);
}
Expand Down

0 comments on commit ff99b8a

Please sign in to comment.