From 4adddeb538da14a8b6e55d2834ea47b4ebbf03bb Mon Sep 17 00:00:00 2001 From: Matthieu Bessat Date: Wed, 23 Aug 2017 15:28:49 +0200 Subject: [PATCH] Add examples and update readme --- README.md | 4 ++-- examples/info.php | 10 ++++++++++ src/DiscordHandler.php | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 examples/info.php diff --git a/README.md b/README.md index d46b47a..342b45d 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ require 'vendor/autoload.php'; $log = new Monolog\Logger('your name'); -$log->pushHandler(new App\MonologDiscordHandler([ +$log->pushHandler(new DiscordHandler\DiscordHandler([ 'Discord Webhook url' ], 'name', 'subname', 'DEBUG')); @@ -46,7 +46,7 @@ require 'vendor/autoload.php'; $log = new Monolog\Logger('your name'); -$log->pushHandler(new App\MonologDiscordHandler([ +$log->pushHandler(new DiscordHandler\DiscordHandler([ 'Discord Webhook url 1', 'Discord Webhook url 2', ], 'name', 'subname', 'DEBUG')); diff --git a/examples/info.php b/examples/info.php new file mode 100644 index 0000000..6282b33 --- /dev/null +++ b/examples/info.php @@ -0,0 +1,10 @@ +pushHandler(new DiscordHandler\DiscordHandler([ +'https://discordapp.com/api/webhooks/349907239303249930/QDPTQxUjaiD3wTrGH14eYa2jyVmdmxG1UNjaOAgP_lmqMEV_-KSq5kt7TG9A5A8GEO10', +], 'name', 'subname', 'DEBUG')); + +$log->info('test'); \ No newline at end of file diff --git a/src/DiscordHandler.php b/src/DiscordHandler.php index 8713491..e2f691e 100644 --- a/src/DiscordHandler.php +++ b/src/DiscordHandler.php @@ -25,7 +25,7 @@ class DiscordHandler extends AbstractProcessingHandler public function __construct($webhooks, $name, $subname = '', $level = Logger::DEBUG, $bubble = true) { $this->name = $name; - $this->subname = $subname + $this->subname = $subname; $this->guzzle = new \GuzzleHttp\Client(); $this->webhooks = $webhooks; parent::__construct($level, $bubble);