1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-01 19:00:20 +02:00

Formatting fixes

This commit is contained in:
Jordi Boggiano
2013-09-16 11:55:31 +02:00
parent 466b1333fd
commit 99aad2e059
3 changed files with 7 additions and 15 deletions

View File

@@ -21,7 +21,6 @@ namespace Monolog\Formatter;
*/
class LogstashFormatter extends NormalizerFormatter
{
const V0 = 0;
const V1 = 1;
@@ -46,7 +45,7 @@ class LogstashFormatter extends NormalizerFormatter
protected $contextPrefix;
/**
* @var integer LogStash format version to use
* @var integer logstash format version to use
*/
protected $version;
@@ -63,10 +62,8 @@ class LogstashFormatter extends NormalizerFormatter
$this->systemName = $systemName ?: gethostname();
$this->applicationName = $applicationName;
$this->extraPrefix = $extraPrefix;
$this->contextPrefix = $contextPrefix;
$this->version = $version;
}
@@ -77,14 +74,10 @@ class LogstashFormatter extends NormalizerFormatter
{
$record = parent::format($record);
switch ($this->version) {
case self::V1:
if ($this->version === self::V1) {
$message = $this->formatV1($record);
break;
case self::V0:
default:
} else {
$message = $this->formatV0($record);
break;
}
return $this->toJson($message) . "\n";

View File

@@ -158,7 +158,6 @@ class LogstashFormatterTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('app', $message['@type']);
}
/**
* @covers Monolog\Formatter\LogstashFormatter::format
*/