Completed
Pull Request — master (#1105)
by Tim
42:55
created

error()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
/**
4
 * functions/application/error.php
5
 *
6
 * NOTICE OF LICENSE
7
 *
8
 * This source file is subject to the Open Software License (OSL 3.0)
9
 * that is available through the world-wide-web at this URL:
10
 * http://opensource.org/licenses/osl-3.0.php
11
 *
12
 * PHP version 5
13
 *
14
 * @author    Tim Wagner <[email protected]>
15
 * @copyright 2018 TechDivision GmbH <[email protected]>
16
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
 * @link      https://github.com/appserver-io/appserver
18
 * @link      http://www.appserver.io
19
 */
20
21
use Psr\Log\LogLevel;
22
use AppserverIo\Appserver\Core\Utilities\LoggerUtils;
23
24
// make sure the function has not already been registered
25
if (!function_exists('error')) {
26
    /**
27
     * Runtime errors that do not require immediate action but should typically
28
     * be logged and monitored.
29
     *
30
     * @param string $message The message to log
31
     * @param array  $context The context for log
32
     *
33
     * @return void
34
     */
35
    function error($message, array $context = array())
36
    {
37
        LoggerUtils::log(LogLevel::ERROR, $message, $context);
38
    }
39
}
40