mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 07:12:47 +08:00
增加debug日志类型 仅限调试模式记录
This commit is contained in:
@@ -32,13 +32,14 @@ class Log
|
|||||||
const SQL = 'sql';
|
const SQL = 'sql';
|
||||||
const NOTICE = 'notice';
|
const NOTICE = 'notice';
|
||||||
const ALERT = 'alert';
|
const ALERT = 'alert';
|
||||||
|
const DEBUG = 'debug';
|
||||||
|
|
||||||
// 日志信息
|
// 日志信息
|
||||||
protected static $log = [];
|
protected static $log = [];
|
||||||
// 配置参数
|
// 配置参数
|
||||||
protected static $config = [];
|
protected static $config = [];
|
||||||
// 日志类型
|
// 日志类型
|
||||||
protected static $type = ['log', 'error', 'info', 'sql', 'notice', 'alert'];
|
protected static $type = ['log', 'error', 'info', 'sql', 'notice', 'alert', 'debug'];
|
||||||
// 日志写入驱动
|
// 日志写入驱动
|
||||||
protected static $driver;
|
protected static $driver;
|
||||||
|
|
||||||
@@ -136,6 +137,9 @@ class Log
|
|||||||
if (empty(self::$config['level'])) {
|
if (empty(self::$config['level'])) {
|
||||||
// 获取全部日志
|
// 获取全部日志
|
||||||
$log = self::$log;
|
$log = self::$log;
|
||||||
|
if (!App::$debug && isset($log['debug'])) {
|
||||||
|
unset($log['debug']);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 记录允许级别
|
// 记录允许级别
|
||||||
$log = [];
|
$log = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user