-
Notifications
You must be signed in to change notification settings - Fork 648
/
log.php
92 lines (80 loc) · 2.2 KB
/
log.php
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
/*
* This file is part of EC-CUBE
*
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
*
* http://www.ec-cube.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
function log_emergency($message, array $context = [])
{
$app = \Eccube\Application::getInstance();
if (isset($app['eccube.logger'])) {
$app['eccube.logger']->emergency($message, $context);
}
}
function log_alert($message, array $context = [])
{
$app = \Eccube\Application::getInstance();
if (isset($app['eccube.logger'])) {
$app['eccube.logger']->alert($message, $context);
}
}
function log_critical($message, array $context = [])
{
$app = \Eccube\Application::getInstance();
if (isset($app['eccube.logger'])) {
$app['eccube.logger']->critical($message, $context);
}
}
function log_error($message, array $context = [])
{
$app = \Eccube\Application::getInstance();
if (isset($app['eccube.logger'])) {
$app['eccube.logger']->error($message, $context);
}
}
function log_warning($message, array $context = [])
{
$app = \Eccube\Application::getInstance();
if (isset($app['eccube.logger'])) {
$app['eccube.logger']->warning($message, $context);
}
}
function log_notice($message, array $context = [])
{
$app = \Eccube\Application::getInstance();
if (isset($app['eccube.logger'])) {
$app['eccube.logger']->notice($message, $context);
}
}
function log_info($message, array $context = [])
{
$app = \Eccube\Application::getInstance();
if (isset($app['eccube.logger'])) {
$app['eccube.logger']->info($message, $context);
}
}
function log_debug($message, array $context = [])
{
$app = \Eccube\Application::getInstance();
if (isset($app['eccube.logger'])) {
$app['eccube.logger']->debug($message, $context);
}
}
/**
* プラグイン用ログ出力関数
*
* @param $channel 設定されたchannel名
*
* @return \Symfony\Bridge\Monolog\Logger
*/
function logs($channel)
{
$app = \Eccube\Application::getInstance();
$container = $app->getParentContainer();
return $container->get('monolog.logger.'.$channel);
}