-
Notifications
You must be signed in to change notification settings - Fork 118
Expand file tree
/
Copy pathRulesStubLogger.php
More file actions
54 lines (45 loc) · 893 Bytes
/
RulesStubLogger.php
File metadata and controls
54 lines (45 loc) · 893 Bytes
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
50
51
52
53
54
<?php
/**
* @file
* Contains \Drupal\rules\Logger\RulesStubLogger.
*/
namespace Drupal\rules\Logger;
use Drupal\Core\Logger\RfcLoggerTrait;
use Psr\Log\LoggerInterface;
/**
* Logs events into the memory with ability check it afterwards.
*/
class RulesStubLogger implements LoggerInterface {
use RfcLoggerTrait;
/**
* The database connection object.
*
* @var array
*/
protected $logs;
/**
* {@inheritdoc}
*/
public function log($level, $message, array $context = array()) {
$this->logs[] = [
'level' => $level,
'message' => $message,
'context' => $context,
];
}
/**
* Clears static logs storage.
*/
public function cleanLogs() {
$this->logs = array();
}
/**
* Returns statically saved logs.
*
* @return array
* Array of logs.
*/
public function getLogs() {
return $this->logs;
}
}