summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordi Boggiano <j.boggiano@seld.be>2016-11-13 20:06:25 +0100
committerGitHub <noreply@github.com>2016-11-13 20:06:25 +0100
commit71c13b8c00f96507734a6479b836419d1e25996c (patch)
tree0f79cccad3f0aded5d49b30b72a2222b4d6f592f
parentd33d11f264d90d517fb8dbca1005f18d4d470440 (diff)
parent0fb49dcfdf7318c0bb01bf6876a44bac0a4a99d1 (diff)
downloadmonolog-71c13b8c00f96507734a6479b836419d1e25996c.zip
monolog-71c13b8c00f96507734a6479b836419d1e25996c.tar.gz
monolog-71c13b8c00f96507734a6479b836419d1e25996c.tar.bz2
Merge pull request #872 from riccardomessineo/master
SlackHandler, new parameter $printSimpleMessage
-rw-r--r--src/Monolog/Handler/SlackHandler.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Monolog/Handler/SlackHandler.php b/src/Monolog/Handler/SlackHandler.php
index f307389..d311e2d 100644
--- a/src/Monolog/Handler/SlackHandler.php
+++ b/src/Monolog/Handler/SlackHandler.php
@@ -79,9 +79,10 @@ class SlackHandler extends SocketHandler
* @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
+ * @param bool $printSimpleMessage Whether the attachment should include only the message without extradata
* @throws MissingExtensionException If no OpenSSL PHP extension configured
*/
- public function __construct($token, $channel, $username = 'Monolog', $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeContextAndExtra = false)
+ public function __construct($token, $channel, $username = 'Monolog', $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeContextAndExtra = false, $printSimpleMessage = false)
{
if (!extension_loaded('openssl')) {
throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler');
@@ -144,7 +145,7 @@ class SlackHandler extends SocketHandler
'attachments' => [],
];
- if ($this->formatter) {
+ if ($this->formatter && !$printSimpleMessage) {
$message = $this->formatter->format($record);
} else {
$message = $record['message'];