mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-05 12:47:39 +02:00
Table constant
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,10 +69,10 @@ class WildfireFormatter extends NormalizerFormatter
|
||||
$message = reset($message);
|
||||
}
|
||||
|
||||
if(isset($record['context']['table'])){
|
||||
if(isset($record['context'][self::TABLE])){
|
||||
$type = 'TYPE';
|
||||
$label = $record['channel'] .': '. $record['message'];
|
||||
$message = $record['context']['table'];
|
||||
$message = $record['context'][self::TABLE];
|
||||
} else {
|
||||
$type = $this->logLevels[$record['level']];
|
||||
$label = $record['channel'];
|
||||
|
@@ -120,7 +120,7 @@ class WildfireFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'level_name' => 'ERROR',
|
||||
'channel' => 'table-channel',
|
||||
'context' => array(
|
||||
'table' => array(
|
||||
WildfireFormatter::TABLE => array(
|
||||
array('col1', 'col2', 'col3'),
|
||||
array('val1', 'val2', 'val3'),
|
||||
array('foo1', 'foo2', 'foo3'),
|
||||
|
Reference in New Issue
Block a user