Skip to content

Commit 0dd9128

Browse files
committed
Support level log channel
1 parent 458d13e commit 0dd9128

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/Channels/LogChannel.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,18 @@
1414

1515
class LogChannel extends Channel
1616
{
17+
/**
18+
* @var string
19+
*/
20+
protected $level;
21+
22+
public function __construct(string $level = 'info')
23+
{
24+
$this->level = $level;
25+
}
26+
1727
public function report(string $report)
1828
{
19-
Log::error($report);
29+
Log::{$this->level}($report);
2030
}
2131
}

src/ExceptionNotifyManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ protected function createFeiShuDriver()
238238

239239
protected function createLogDriver()
240240
{
241-
return new LogChannel();
241+
return new LogChannel(config('exception-notify.default.channels.log.level', 'info'));
242242
}
243243

244244
protected function createMailDriver()

0 commit comments

Comments
 (0)