1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-24 01:56:18 +02:00
This commit is contained in:
Jordi Boggiano
2017-03-20 10:56:47 +01:00
parent 9a11094c66
commit 7405bb5d67
20 changed files with 85 additions and 84 deletions

View File

@@ -76,7 +76,6 @@ class LineFormatter extends NormalizerFormatter
}
}
foreach ($vars['context'] as $var => $val) {
if (false !== strpos($output, '%context.'.$var.'%')) {
$output = str_replace('%context.'.$var.'%', $this->stringify($val), $output);

View File

@@ -18,7 +18,6 @@ namespace Monolog\Formatter;
*/
class LogmaticFormatter extends JsonFormatter
{
const MARKERS = ["sourcecode", "php"];
/**

View File

@@ -57,7 +57,7 @@ class NormalizerFormatter implements FormatterInterface
}
/**
* @param mixed $data
* @param mixed $data
* @return int|bool|string|null|array
*/
protected function normalize($data, int $depth = 0)

View File

@@ -3,7 +3,7 @@
/*
* This file is part of the Monolog package.
*
* (c) Roel Harbers <roelharbers@gmail.com>
* (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.
@@ -11,8 +11,6 @@
namespace Monolog\Handler;
use Monolog\Logger;
/**
* No-op
*

View File

@@ -66,10 +66,10 @@ class PHPConsoleHandler extends AbstractProcessingHandler
private $connector;
/**
* @param array $options See \Monolog\Handler\PHPConsoleHandler::$options for more details
* @param Connector|null $connector Instance of \PhpConsole\Connector class (optional)
* @param int $level
* @param bool $bubble
* @param array $options See \Monolog\Handler\PHPConsoleHandler::$options for more details
* @param Connector|null $connector Instance of \PhpConsole\Connector class (optional)
* @param int $level
* @param bool $bubble
* @throws RuntimeException
*/
public function __construct(array $options = [], Connector $connector = null, $level = Logger::DEBUG, $bubble = true)

View File

@@ -222,7 +222,7 @@ class RavenHandler extends AbstractProcessingHandler
}
/**
* @param string $value
* @param string $value
* @return self
*/
public function setRelease($value)

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
@@ -127,7 +127,7 @@ class SlackRecord
'color' => $this->getAttachmentColor($record['level']),
'fields' => array(),
'mrkdwn_in' => array('fields'),
'ts' => $record['datetime']->getTimestamp()
'ts' => $record['datetime']->getTimestamp(),
);
if ($this->useShortAttachment) {
@@ -137,7 +137,6 @@ class SlackRecord
$attachment['fields'][] = $this->generateAttachmentField('Level', $record['level_name']);
}
if ($this->includeContextAndExtra) {
foreach (array('extra', 'context') as $key) {
if (empty($record[$key])) {
@@ -229,7 +228,7 @@ class SlackRecord
/**
* Generates attachment field
*
* @param string $title
* @param string $title
* @param string|array $value\
*
* @return array
@@ -243,7 +242,7 @@ class SlackRecord
return array(
'title' => $title,
'value' => $value,
'short' => false
'short' => false,
);
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
@@ -36,16 +36,16 @@ class SlackWebhookHandler extends AbstractProcessingHandler
private $slackRecord;
/**
* @param string $webhookUrl Slack Webhook URL
* @param string|null $channel Slack channel (encoded ID or name)
* @param string|null $username Name of a bot
* @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise)
* @param string|null $iconEmoji The emoji name to use (or null)
* @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style
* @param bool $includeContextAndExtra Whether the attachment should include context and extra data
* @param int $level The minimum logging level at which this handler will be triggered
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
* @param array $excludeFields Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2']
* @param string $webhookUrl Slack Webhook URL
* @param string|null $channel Slack channel (encoded ID or name)
* @param string|null $username Name of a bot
* @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise)
* @param string|null $iconEmoji The emoji name to use (or null)
* @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style
* @param bool $includeContextAndExtra Whether the attachment should include context and extra data
* @param int $level The minimum logging level at which this handler will be triggered
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
* @param array $excludeFields Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2']
*/
public function __construct($webhookUrl, $channel = null, $username = null, $useAttachment = true, $iconEmoji = null, $useShortAttachment = false, $includeContextAndExtra = false, $level = Logger::CRITICAL, $bubble = true, array $excludeFields = array())
{

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
@@ -40,11 +40,11 @@ class SlackbotHandler extends AbstractProcessingHandler
private $channel;
/**
* @param string $slackTeam Slack team slug
* @param string $token Slackbot token
* @param string $channel Slack channel (encoded ID or name)
* @param int $level The minimum logging level at which this handler will be triggered
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
* @param string $slackTeam Slack team slug
* @param string $token Slackbot token
* @param string $channel Slack channel (encoded ID or name)
* @param int $level The minimum logging level at which this handler will be triggered
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
*/
public function __construct($slackTeam, $token, $channel, $level = Logger::CRITICAL, $bubble = true)
{

View File

@@ -125,7 +125,7 @@ class StreamHandler extends AbstractProcessingHandler
/**
* Write to stream
* @param resource $stream
* @param array $record
* @param array $record
*/
protected function streamWrite($stream, array $record)
{

View File

@@ -397,9 +397,9 @@ class Logger implements LoggerInterface
*
* This method allows for compatibility with common interfaces.
*
* @param mixed $level The log level
* @param string $message The log message
* @param array $context The log context
* @param mixed $level The log level
* @param string $message The log message
* @param array $context The log context
*/
public function log($level, $message, array $context = [])
{
@@ -413,8 +413,8 @@ class Logger implements LoggerInterface
*
* This method allows for compatibility with common interfaces.
*
* @param string $message The log message
* @param array $context The log context
* @param string $message The log message
* @param array $context The log context
*/
public function debug($message, array $context = [])
{
@@ -426,8 +426,8 @@ class Logger implements LoggerInterface
*
* This method allows for compatibility with common interfaces.
*
* @param string $message The log message
* @param array $context The log context
* @param string $message The log message
* @param array $context The log context
*/
public function info($message, array $context = [])
{
@@ -439,8 +439,8 @@ class Logger implements LoggerInterface
*
* This method allows for compatibility with common interfaces.
*
* @param string $message The log message
* @param array $context The log context
* @param string $message The log message
* @param array $context The log context
*/
public function notice($message, array $context = [])
{
@@ -452,8 +452,8 @@ class Logger implements LoggerInterface
*
* This method allows for compatibility with common interfaces.
*
* @param string $message The log message
* @param array $context The log context
* @param string $message The log message
* @param array $context The log context
*/
public function warning($message, array $context = [])
{
@@ -465,8 +465,8 @@ class Logger implements LoggerInterface
*
* This method allows for compatibility with common interfaces.
*
* @param string $message The log message
* @param array $context The log context
* @param string $message The log message
* @param array $context The log context
*/
public function error($message, array $context = [])
{
@@ -478,8 +478,8 @@ class Logger implements LoggerInterface
*
* This method allows for compatibility with common interfaces.
*
* @param string $message The log message
* @param array $context The log context
* @param string $message The log message
* @param array $context The log context
*/
public function critical($message, array $context = [])
{
@@ -491,8 +491,8 @@ class Logger implements LoggerInterface
*
* This method allows for compatibility with common interfaces.
*
* @param string $message The log message
* @param array $context The log context
* @param string $message The log message
* @param array $context The log context
*/
public function alert($message, array $context = [])
{
@@ -504,8 +504,8 @@ class Logger implements LoggerInterface
*
* This method allows for compatibility with common interfaces.
*
* @param string $message The log message
* @param array $context The log context
* @param string $message The log message
* @param array $context The log context
*/
public function emergency($message, array $context = [])
{

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.