1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-22 17:16:18 +02:00

Make $initialized static

Removed custom writer, overriding is easy enough
CS fixes
Added TestFirePHPHandler class to enable testing of headers
This commit is contained in:
Jordi Boggiano
2011-04-25 15:48:52 +02:00
parent a0b8f75b2b
commit 2b1c68e0d0
3 changed files with 83 additions and 138 deletions

View File

@@ -20,7 +20,6 @@ use Monolog\Logger;
*/
class WildfireFormatter extends LineFormatter implements FormatterInterface
{
/**
* Similar to LineFormatter::SIMPLE_FORMAT, except without the "[%datetime%]"
*/
@@ -48,7 +47,7 @@ class WildfireFormatter extends LineFormatter implements FormatterInterface
{
// Format record according with LineFormatter
$formatted = parent::format($record);
// Create JSON object describing the appearance of the message in the console
$json = json_encode(array(
array(
@@ -58,14 +57,14 @@ class WildfireFormatter extends LineFormatter implements FormatterInterface
),
$formatted['message'],
));
// The message itself is a serialization of the above JSON object + it's length
$formatted['message'] = sprintf(
'%s|%s|',
strlen($json),
$json
);
return $formatted;
}