~xibo-maintainers/xibo/tempel

« back to all changes in this revision

Viewing changes to lib/Xmds/LogProcessor.php

  • Committer: Dan Garner
  • Date: 2016-02-18 16:07:16 UTC
  • mfrom: (454.4.137)
  • Revision ID: git-v1:8867f12675bc9e0e67e7e622c80da7471b9f294a
Merge pull request #139 from dasgarner/feature/nested-display-groups

Feature/nested display groups

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
namespace Xibo\Xmds;
10
10
 
11
 
use Slim\Log;
12
 
 
13
 
/**
14
 
 * Class LogProcessor
15
 
 * @package Xibo\Xmds
16
 
 */
17
11
class LogProcessor
18
12
{
19
 
    /** @var  Log */
20
 
    private $log;
21
13
    private $displayId;
22
14
    private $route;
23
15
    private $method;
24
 
    private $uid;
25
16
 
26
17
    /**
27
18
     * Log Processor
28
 
     * @param Log $log
29
19
     * @param string $method
30
20
     */
31
 
    public function __construct($log, $uid, $method = 'POST')
 
21
    public function __construct($method = 'POST')
32
22
    {
33
 
        $this->log = $log;
34
 
        $this->uid = $uid;
35
23
        $this->method = $method;
36
24
    }
37
25
 
38
 
    /**
39
 
     * @param $route
40
 
     */
41
26
    public function setRoute($route)
42
27
    {
43
28
        $this->route = $route;
44
29
    }
45
30
 
46
 
    /**
47
 
     * @param $displayId
48
 
     * @param bool $isAuditing
49
 
     */
50
 
    public function setDisplay($displayId, $isAuditing)
 
31
    public function setDisplay($displayId)
51
32
    {
52
 
        if ($isAuditing)
53
 
            $this->log->setLevel(\Xibo\Service\LogService::resolveLogLevel('debug'));
54
 
 
55
33
        $this->displayId = $displayId;
56
34
    }
57
35
 
58
 
    /**
59
 
     * Get Log Level
60
 
     * @return int
61
 
     */
62
 
    public function getLevel()
63
 
    {
64
 
        return $this->log->getLevel();
65
 
    }
66
 
 
67
 
    /**
68
 
     * Get UID
69
 
     * @return string
70
 
     */
71
 
    public function getUid()
72
 
    {
73
 
        return $this->uid;
74
 
    }
75
 
 
76
 
    /**
77
 
     * @param array $record
78
 
     * @return array
79
 
     */
80
36
    public function __invoke(array $record)
81
37
    {
82
38
        $record['extra']['displayId'] = $this->displayId;