mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-07 13:46:38 +02:00
Rename var for clarity
This commit is contained in:
@@ -53,16 +53,16 @@ class SlackHandler extends SocketHandler
|
|||||||
private $useAttachment;
|
private $useAttachment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the the message that is added to Slack as attachment is in a short style (or not)
|
* Whether the the context/extra messages added to Slack as attachments are in a short style
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
private $useShortAttachment;
|
private $useShortAttachment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the attachment should include extra data (or not)
|
* Whether the attachment should include context and extra data
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
private $includeExtra;
|
private $includeContextAndExtra;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var LineFormatter
|
* @var LineFormatter
|
||||||
@@ -77,8 +77,10 @@ class SlackHandler extends SocketHandler
|
|||||||
* @param string|null $iconEmoji The emoji name to use (or null)
|
* @param string|null $iconEmoji The emoji name to use (or null)
|
||||||
* @param int $level The minimum logging level at which this handler will be triggered
|
* @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 bool $bubble Whether the messages that are handled can bubble up the stack or not
|
||||||
|
* @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
|
||||||
*/
|
*/
|
||||||
public function __construct($token, $channel, $username = 'Monolog', $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeExtra = false)
|
public function __construct($token, $channel, $username = 'Monolog', $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeContextAndExtra = false)
|
||||||
{
|
{
|
||||||
if (!extension_loaded('openssl')) {
|
if (!extension_loaded('openssl')) {
|
||||||
throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler');
|
throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler');
|
||||||
@@ -92,8 +94,8 @@ class SlackHandler extends SocketHandler
|
|||||||
$this->iconEmoji = trim($iconEmoji, ':');
|
$this->iconEmoji = trim($iconEmoji, ':');
|
||||||
$this->useAttachment = $useAttachment;
|
$this->useAttachment = $useAttachment;
|
||||||
$this->useShortAttachment = $useShortAttachment;
|
$this->useShortAttachment = $useShortAttachment;
|
||||||
$this->includeExtra = $includeExtra;
|
$this->includeContextAndExtra = $includeContextAndExtra;
|
||||||
if ($this->includeExtra) {
|
if ($this->includeContextAndExtra) {
|
||||||
$this->lineFormatter = new LineFormatter;
|
$this->lineFormatter = new LineFormatter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -156,7 +158,7 @@ class SlackHandler extends SocketHandler
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->includeExtra) {
|
if ($this->includeContextAndExtra) {
|
||||||
if (!empty($record['extra'])) {
|
if (!empty($record['extra'])) {
|
||||||
if ($this->useShortAttachment) {
|
if ($this->useShortAttachment) {
|
||||||
$attachment['fields'][] = array(
|
$attachment['fields'][] = array(
|
||||||
|
Reference in New Issue
Block a user