Skip to content

Commit

Permalink
Add examples and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lefuturiste committed Aug 23, 2017
1 parent 134d919 commit 4adddeb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'));

Expand All @@ -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'));
Expand Down
10 changes: 10 additions & 0 deletions examples/info.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
require '../vendor/autoload.php';

$log = new Monolog\Logger('your name');

$log->pushHandler(new DiscordHandler\DiscordHandler([
'https://discordapp.com/api/webhooks/349907239303249930/QDPTQxUjaiD3wTrGH14eYa2jyVmdmxG1UNjaOAgP_lmqMEV_-KSq5kt7TG9A5A8GEO10',
], 'name', 'subname', 'DEBUG'));

$log->info('test');
2 changes: 1 addition & 1 deletion src/DiscordHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4adddeb

Please sign in to comment.