-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathAbstractLog.php
49 lines (43 loc) · 1.24 KB
/
AbstractLog.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
declare(strict_types=1);
/**
*
* @author xiaoguo0426
* @contact [email protected]
* @license MIT
*/
namespace App\Util\Log;
use App\Kernel\Log;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Psr\Log\LoggerInterface;
/**
* Log基础类
* Class AbstractConsoleLog.
*
* @method void log(mixed $level, string $message, array $context = [])
* @method void debug($message, array $context = [])
* @method void info($message, array $context = [])
* @method void notice($message, array $context = [])
* @method void warning($message, array $context = [])
* @method void error($message, array $context = [])
* @method void critical($message, array $context = [])
* @method void alert($message, array $context = [])
* @method void emergency($message, array $context = [])
*/
abstract class AbstractLog
{
private LoggerInterface $logger;
/**
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function __construct(string $channel = '', string $group = '')
{
$this->logger = Log::get($channel, $group);
}
public function __call($name, $arguments)
{
return $this->logger->{$name}(...$arguments);
}
}