Completed
Push — master ( bba72d...f3c8fa )
by Derek
02:08
created

System::initialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace Subreality\Dilmun\Nabu\LoggerHandler;
4
5
/**
6
 * Class System
7
 *
8
 * Simple log handler that writes to the system log using error_log.
9
 *
10
 * @package Subreality\Dilmun\Nabu\LoggerHandler
11
 *
12
 * @see error_log()
13
 */
14
class System implements HandlerInterface
15
{
16
    public function __construct()
17
    {
18
        //No construction required!
19
    }
20
21
    /**
22
     * @return bool
23
     */
24
    public function initialize()
25
    {
26
        $initialize_status = error_log("Initalizing System logger.");
27
28
        return $initialize_status;
29
    }
30
31
    /**
32
     * Writes to the configured PHP error logger.
33
     *
34
     * @see error_log()
35
     *
36
     * @param string $message   Message to be written to PHP's system log
37
     * @return bool             Returns the status from the error_log function
38
     */
39
    public function write($message)
40
    {
41
        $write_status = error_log($message);
42
43
        return $write_status;
44
    }
45
}