mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-25 10:36:33 +02:00
Merge pull request #345 from snapshotpl/formater
Fix #150: Table formatter for FirePHP
This commit is contained in:
@@ -22,6 +22,8 @@ use Monolog\Logger;
|
||||
*/
|
||||
class WildfireFormatter extends NormalizerFormatter
|
||||
{
|
||||
const TABLE = 'table';
|
||||
|
||||
/**
|
||||
* Translates Monolog log levels to Wildfire levels.
|
||||
*/
|
||||
@@ -67,13 +69,22 @@ class WildfireFormatter extends NormalizerFormatter
|
||||
$message = reset($message);
|
||||
}
|
||||
|
||||
if(isset($record['context'][self::TABLE])){
|
||||
$type = 'TABLE';
|
||||
$label = $record['channel'] .': '. $record['message'];
|
||||
$message = $record['context'][self::TABLE];
|
||||
} else {
|
||||
$type = $this->logLevels[$record['level']];
|
||||
$label = $record['channel'];
|
||||
}
|
||||
|
||||
// Create JSON object describing the appearance of the message in the console
|
||||
$json = $this->toJson(array(
|
||||
array(
|
||||
'Type' => $this->logLevels[$record['level']],
|
||||
'Type' => $type,
|
||||
'File' => $file,
|
||||
'Line' => $line,
|
||||
'Label' => $record['channel'],
|
||||
'Label' => $label,
|
||||
),
|
||||
$message,
|
||||
), $handleError);
|
||||
|
||||
Reference in New Issue
Block a user