mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-04 12:17:35 +02:00
CS fixes
This commit is contained in:
@@ -69,7 +69,7 @@ class WildfireFormatter extends NormalizerFormatter
|
|||||||
$message = reset($message);
|
$message = reset($message);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($record['context'][self::TABLE])){
|
if (isset($record['context'][self::TABLE])) {
|
||||||
$type = 'TABLE';
|
$type = 'TABLE';
|
||||||
$label = $record['channel'] .': '. $record['message'];
|
$label = $record['channel'] .': '. $record['message'];
|
||||||
$message = $record['context'][self::TABLE];
|
$message = $record['context'][self::TABLE];
|
||||||
|
@@ -12,7 +12,6 @@
|
|||||||
namespace Monolog\Handler;
|
namespace Monolog\Handler;
|
||||||
|
|
||||||
use Monolog\Logger;
|
use Monolog\Logger;
|
||||||
use Monolog\Formatter\LineFormatter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Robert Kaufmann III <rok3@rok3.me>
|
* @author Robert Kaufmann III <rok3@rok3.me>
|
||||||
@@ -55,4 +54,4 @@ class LogEntriesHandler extends SocketHandler
|
|||||||
return $this->logToken . ' ' . $record['formatted'];
|
return $this->logToken . ' ' . $record['formatted'];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -30,16 +30,16 @@ class PushoverHandler extends SocketHandler
|
|||||||
|
|
||||||
private $highPriorityLevel;
|
private $highPriorityLevel;
|
||||||
private $emergencyLevel;
|
private $emergencyLevel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sounds the api supports by default
|
* Sounds the api supports by default
|
||||||
* @see https://pushover.net/api#sounds
|
* @see https://pushover.net/api#sounds
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
private $sounds = array(
|
private $sounds = array(
|
||||||
'pushover', 'bike', 'bugle', 'cashregister', 'classical', 'cosmic', 'falling', 'gamelan', 'incoming',
|
'pushover', 'bike', 'bugle', 'cashregister', 'classical', 'cosmic', 'falling', 'gamelan', 'incoming',
|
||||||
'intermission', 'magic', 'mechanical', 'pianobar', 'siren', 'spacealarm', 'tugboat', 'alien', 'climb',
|
'intermission', 'magic', 'mechanical', 'pianobar', 'siren', 'spacealarm', 'tugboat', 'alien', 'climb',
|
||||||
'persistent', 'echo', 'updown', 'none',
|
'persistent', 'echo', 'updown', 'none',
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -100,7 +100,7 @@ class PushoverHandler extends SocketHandler
|
|||||||
} elseif ($record['level'] >= $this->highPriorityLevel) {
|
} elseif ($record['level'] >= $this->highPriorityLevel) {
|
||||||
$dataArray['priority'] = 1;
|
$dataArray['priority'] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($record['context']['sound']) && in_array($record['context']['sound'], $this->sounds)) {
|
if (isset($record['context']['sound']) && in_array($record['context']['sound'], $this->sounds)) {
|
||||||
$dataArray['sound'] = $record['context']['sound'];
|
$dataArray['sound'] = $record['context']['sound'];
|
||||||
} elseif (isset($record['extra']['sound']) && in_array($record['extra']['sound'], $this->sounds)) {
|
} elseif (isset($record['extra']['sound']) && in_array($record['extra']['sound'], $this->sounds)) {
|
||||||
|
@@ -33,10 +33,10 @@ class RotatingFileHandler extends StreamHandler
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $filename
|
* @param string $filename
|
||||||
* @param integer $maxFiles The maximal amount of files to keep (0 means unlimited)
|
* @param integer $maxFiles The maximal amount of files to keep (0 means unlimited)
|
||||||
* @param integer $level The minimum logging level at which this handler will be triggered
|
* @param integer $level The minimum logging level at which this handler will be triggered
|
||||||
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
|
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
|
||||||
* @param int $filePermissions Optional file permissions (default (0644) are only for owner read/write)
|
* @param int $filePermissions Optional file permissions (default (0644) are only for owner read/write)
|
||||||
*/
|
*/
|
||||||
public function __construct($filename, $maxFiles = 0, $level = Logger::DEBUG, $bubble = true, $filePermission = 0644)
|
public function __construct($filename, $maxFiles = 0, $level = Logger::DEBUG, $bubble = true, $filePermission = 0644)
|
||||||
{
|
{
|
||||||
|
@@ -29,7 +29,7 @@ abstract class MemoryProcessor
|
|||||||
protected $useFormatting;
|
protected $useFormatting;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param boolean $realUsage Set this to true to get the real size of memory allocated from system.
|
* @param boolean $realUsage Set this to true to get the real size of memory allocated from system.
|
||||||
* @param boolean $useFormatting If true, then format memory size to human readable string (MB, KB, B depending on size)
|
* @param boolean $useFormatting If true, then format memory size to human readable string (MB, KB, B depending on size)
|
||||||
*/
|
*/
|
||||||
public function __construct($realUsage = true, $useFormatting = true)
|
public function __construct($realUsage = true, $useFormatting = true)
|
||||||
@@ -41,7 +41,7 @@ abstract class MemoryProcessor
|
|||||||
/**
|
/**
|
||||||
* Formats bytes into a human readable string if $this->useFormatting is true, otherwise return $bytes as is
|
* Formats bytes into a human readable string if $this->useFormatting is true, otherwise return $bytes as is
|
||||||
*
|
*
|
||||||
* @param int $bytes
|
* @param int $bytes
|
||||||
* @return string|int Formatted string if $this->useFormatting is true, otherwise return $bytes as is
|
* @return string|int Formatted string if $this->useFormatting is true, otherwise return $bytes as is
|
||||||
*/
|
*/
|
||||||
protected function formatBytes($bytes)
|
protected function formatBytes($bytes)
|
||||||
|
@@ -13,7 +13,6 @@ namespace Monolog\Handler;
|
|||||||
|
|
||||||
use Monolog\TestCase;
|
use Monolog\TestCase;
|
||||||
use Monolog\Logger;
|
use Monolog\Logger;
|
||||||
use Monolog\Formatter\LineFormatter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Robert Kaufmann III <rok3@rok3.me>
|
* @author Robert Kaufmann III <rok3@rok3.me>
|
||||||
@@ -43,10 +42,10 @@ class LogEntriesHandlerTest extends TestCase
|
|||||||
|
|
||||||
public function testWriteBatchContent()
|
public function testWriteBatchContent()
|
||||||
{
|
{
|
||||||
$records = array(
|
$records = array(
|
||||||
$this->getRecord(),
|
$this->getRecord(),
|
||||||
$this->getRecord(),
|
$this->getRecord(),
|
||||||
$this->getRecord()
|
$this->getRecord()
|
||||||
);
|
);
|
||||||
$this->createHandler();
|
$this->createHandler();
|
||||||
$this->handler->handleBatch($records);
|
$this->handler->handleBatch($records);
|
||||||
|
@@ -72,7 +72,7 @@ class RavenHandlerTest extends TestCase
|
|||||||
$this->assertEquals($ravenClient::WARNING, $ravenClient->lastData['level']);
|
$this->assertEquals($ravenClient::WARNING, $ravenClient->lastData['level']);
|
||||||
$this->assertContains($record['message'], $ravenClient->lastData['message']);
|
$this->assertContains($record['message'], $ravenClient->lastData['message']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testTag()
|
public function testTag()
|
||||||
{
|
{
|
||||||
$ravenClient = $this->getRavenClient();
|
$ravenClient = $this->getRavenClient();
|
||||||
|
@@ -23,7 +23,7 @@ class TagProcessorTest extends TestCase
|
|||||||
$tags = array(1, 2, 3);
|
$tags = array(1, 2, 3);
|
||||||
$processor = new TagProcessor($tags);
|
$processor = new TagProcessor($tags);
|
||||||
$record = $processor($this->getRecord());
|
$record = $processor($this->getRecord());
|
||||||
|
|
||||||
$this->assertEquals($tags, $record['extra']['tags']);
|
$this->assertEquals($tags, $record['extra']['tags']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user