1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types = 1); |
4
|
|
|
|
5
|
|
|
namespace unreal4u\TelegramAPI\InternalFunctionality; |
6
|
|
|
|
7
|
|
|
use Psr\Log\LoggerInterface; |
8
|
|
|
use Psr\Log\LogLevel; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* Special class that will act as backup in case no logger is given |
12
|
|
|
* |
13
|
|
|
* As the name implies, this class won't do anything except declare the methods so we can still call them in this API. |
14
|
|
|
*/ |
15
|
|
|
class DummyLogger implements LoggerInterface |
16
|
|
|
{ |
17
|
1 |
|
public function emergency($message, array $context = array()): bool |
18
|
|
|
{ |
19
|
1 |
|
return $this->log(LogLevel::EMERGENCY, $message, $context); |
20
|
|
|
} |
21
|
|
|
|
22
|
1 |
|
public function alert($message, array $context = array()): bool |
23
|
|
|
{ |
24
|
1 |
|
return $this->log(LogLevel::ALERT, $message, $context); |
25
|
|
|
} |
26
|
|
|
|
27
|
1 |
|
public function critical($message, array $context = array()): bool |
28
|
|
|
{ |
29
|
1 |
|
return $this->log(LogLevel::CRITICAL, $message, $context); |
30
|
|
|
} |
31
|
|
|
|
32
|
1 |
|
public function error($message, array $context = array()): bool |
33
|
|
|
{ |
34
|
1 |
|
return $this->log(LogLevel::ERROR, $message, $context); |
35
|
|
|
} |
36
|
|
|
|
37
|
1 |
|
public function warning($message, array $context = array()): bool |
38
|
|
|
{ |
39
|
1 |
|
return $this->log(LogLevel::WARNING, $message, $context); |
40
|
|
|
} |
41
|
|
|
|
42
|
1 |
|
public function notice($message, array $context = array()): bool |
43
|
|
|
{ |
44
|
1 |
|
return $this->log(LogLevel::NOTICE, $message, $context); |
45
|
|
|
} |
46
|
|
|
|
47
|
25 |
|
public function info($message, array $context = array()): bool |
48
|
|
|
{ |
49
|
25 |
|
return $this->log(LogLevel::INFO, $message, $context); |
50
|
|
|
} |
51
|
|
|
|
52
|
28 |
|
public function debug($message, array $context = array()): bool |
53
|
|
|
{ |
54
|
28 |
|
return $this->log(LogLevel::DEBUG, $message, $context); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @SuppressWarnings("unused") |
59
|
|
|
* @param mixed $level |
60
|
|
|
* @param string $message |
61
|
|
|
* @param array $context |
62
|
|
|
* @return bool |
63
|
|
|
*/ |
64
|
36 |
|
public function log($level, $message, array $context = array()): bool |
65
|
|
|
{ |
66
|
36 |
|
return false; |
67
|
|
|
} |
68
|
|
|
} |
69
|
|
|
|