1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-04 12:17:35 +02:00
This commit is contained in:
Jordi Boggiano
2014-03-23 20:50:26 +01:00
parent 8222de98a4
commit 392ef35fd4
29 changed files with 55 additions and 88 deletions

View File

@@ -42,6 +42,7 @@ class LogglyFormatter extends JsonFormatter
$record["timestamp"] = $record["datetime"]->format("c"); $record["timestamp"] = $record["datetime"]->format("c");
// @todo unset the 'datetime' parameter, retained for BC // @todo unset the 'datetime' parameter, retained for BC
} }
return parent::format($record); return parent::format($record);
} }

View File

@@ -11,7 +11,6 @@
namespace Monolog\Handler; namespace Monolog\Handler;
use Monolog\Logger;
use Monolog\Formatter\LineFormatter; use Monolog\Formatter\LineFormatter;
/** /**
@@ -103,6 +102,7 @@ class BrowserConsoleHandler extends AbstractProcessingHandler
); );
} }
} }
return "(function (c) {if (c && c.groupCollapsed) {\n" . implode("\n", $script) . "\n}})(console);"; return "(function (c) {if (c && c.groupCollapsed) {\n" . implode("\n", $script) . "\n}})(console);";
} }
@@ -160,6 +160,7 @@ class BrowserConsoleHandler extends AbstractProcessingHandler
} }
$script[] = self::call('log', self::quote('%s: %o'), self::quote($key), $value); $script[] = self::call('log', self::quote('%s: %o'), self::quote($key), $value);
} }
return $script; return $script;
} }
@@ -172,6 +173,7 @@ class BrowserConsoleHandler extends AbstractProcessingHandler
{ {
$args = func_get_args(); $args = func_get_args();
$method = array_shift($args); $method = array_shift($args);
return self::call_array($method, $args); return self::call_array($method, $args);
} }

View File

@@ -14,7 +14,6 @@ namespace Monolog\Handler;
use Aws\Common\Aws; use Aws\Common\Aws;
use Aws\DynamoDb\DynamoDbClient; use Aws\DynamoDb\DynamoDbClient;
use Monolog\Formatter\ScalarFormatter; use Monolog\Formatter\ScalarFormatter;
use Monolog\Handler\AbstractProcessingHandler;
use Monolog\Logger; use Monolog\Logger;
/** /**

View File

@@ -130,6 +130,7 @@ class NativeMailerHandler extends MailHandler
public function setContentType($contentType) public function setContentType($contentType)
{ {
$this->contentType = $contentType; $this->contentType = $contentType;
return $this; return $this;
} }
@@ -140,6 +141,7 @@ class NativeMailerHandler extends MailHandler
public function setEncoding($encoding) public function setEncoding($encoding)
{ {
$this->encoding = $encoding; $this->encoding = $encoding;
return $this; return $this;
} }
} }

View File

@@ -14,7 +14,6 @@ namespace Monolog\Handler;
use Monolog\Formatter\LineFormatter; use Monolog\Formatter\LineFormatter;
use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\FormatterInterface;
use Monolog\Logger; use Monolog\Logger;
use Monolog\Handler\AbstractProcessingHandler;
use Raven_Client; use Raven_Client;
/** /**

View File

@@ -12,7 +12,6 @@
namespace Monolog\Formatter; namespace Monolog\Formatter;
use Monolog\Logger; use Monolog\Logger;
use Monolog\Formatter\ElasticaFormatter;
class ElasticaFormatterTest extends \PHPUnit_Framework_TestCase class ElasticaFormatterTest extends \PHPUnit_Framework_TestCase
{ {

View File

@@ -12,7 +12,6 @@
namespace Monolog\Formatter; namespace Monolog\Formatter;
use Monolog\Logger; use Monolog\Logger;
use Monolog\Formatter\GelfMessageFormatter;
class GelfMessageFormatterTest extends \PHPUnit_Framework_TestCase class GelfMessageFormatterTest extends \PHPUnit_Framework_TestCase
{ {

View File

@@ -11,7 +11,6 @@
namespace Monolog\Formatter; namespace Monolog\Formatter;
use Monolog\Logger;
use Monolog\TestCase; use Monolog\TestCase;
class LogglyFormatterTest extends TestCase class LogglyFormatterTest extends TestCase

View File

@@ -12,7 +12,6 @@
namespace Monolog\Formatter; namespace Monolog\Formatter;
use Monolog\Logger; use Monolog\Logger;
use Monolog\Formatter\LogstashFormatter;
class LogstashFormatterTest extends \PHPUnit_Framework_TestCase class LogstashFormatterTest extends \PHPUnit_Framework_TestCase
{ {

View File

@@ -11,7 +11,6 @@
namespace Monolog\Handler; namespace Monolog\Handler;
use Monolog\Handler\ElasticSearchHandler;
use Monolog\Formatter\ElasticaFormatter; use Monolog\Formatter\ElasticaFormatter;
use Monolog\Formatter\NormalizerFormatter; use Monolog\Formatter\NormalizerFormatter;
use Monolog\TestCase; use Monolog\TestCase;
@@ -234,6 +233,7 @@ class ElasticSearchHandlerTest extends TestCase
if (!empty($data['_source'])) { if (!empty($data['_source'])) {
return $data['_source']; return $data['_source'];
} }
return array(); return array();
} }
} }

View File

@@ -23,8 +23,6 @@ class GelfHandlerLegacyTest extends TestCase
if (!class_exists('Gelf\MessagePublisher') || !class_exists('Gelf\Message')) { if (!class_exists('Gelf\MessagePublisher') || !class_exists('Gelf\Message')) {
$this->markTestSkipped("mlehner/gelf-php not installed"); $this->markTestSkipped("mlehner/gelf-php not installed");
} }
require_once __DIR__ . '/GelfMocks.php';
} }
/** /**

View File

@@ -64,7 +64,6 @@ class GelfHandlerTest extends TestCase
$handler = $this->getHandler($messagePublisher); $handler = $this->getHandler($messagePublisher);
$handler->handle($record); $handler->handle($record);
} }
@@ -87,7 +86,6 @@ class GelfHandlerTest extends TestCase
$handler = $this->getHandler($messagePublisher); $handler = $this->getHandler($messagePublisher);
$handler->handle($record); $handler->handle($record);
} }

View File

@@ -1,25 +0,0 @@
<?php
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Handler;
use Gelf\MessagePublisher;
use Gelf\Message;
class MockMessagePublisher extends MessagePublisher
{
public function publish(Message $message)
{
$this->lastMessage = $message;
}
public $lastMessage = null;
}

View File

@@ -14,7 +14,6 @@ namespace Monolog\Handler;
use Monolog\TestCase; use Monolog\TestCase;
use Monolog\Logger; use Monolog\Logger;
use Monolog\Formatter\LineFormatter; use Monolog\Formatter\LineFormatter;
use Monolog\Handler\RavenHandler;
class RavenHandlerTest extends TestCase class RavenHandlerTest extends TestCase
{ {

View File

@@ -2,8 +2,6 @@
namespace Monolog\Handler; namespace Monolog\Handler;
use Monolog\TestCase;
class SyslogUdpHandlerTest extends \PHPUnit_Framework_TestCase class SyslogUdpHandlerTest extends \PHPUnit_Framework_TestCase
{ {
/** /**