1)修正notice 的拼写错误;2)英文的":"后面加了个空格;3)补全Log::send() 注释;4)删除Error.php 里重复的 key;5)添加 File Log 测试用例

This commit is contained in:
jinchun
2016-02-02 20:02:37 +08:00
parent 8ed7c91b29
commit 927c075f29
7 changed files with 49 additions and 18 deletions

View File

@@ -13,17 +13,17 @@ namespace think;
class Log
{
const LOG = 'log';
const ERROR = 'error';
const INFO = 'info';
const SQL = 'sql';
const NOTIC = 'notic';
const ALERT = 'alert';
const LOG = 'log';
const ERROR = 'error';
const INFO = 'info';
const SQL = 'sql';
const NOTICE = 'notice';
const ALERT = 'alert';
// 日志信息
protected static $log = [];
// 日志类型
protected static $type = ['log', 'error', 'info', 'sql', 'notic', 'alert'];
protected static $type = ['log', 'error', 'info', 'sql', 'notice', 'alert'];
// 日志写入驱动
protected static $driver = null;
// 通知发送驱动
@@ -37,7 +37,7 @@ class Log
unset($config['type']);
self::$driver = new $class($config);
// 记录初始化信息
APP_DEBUG && Log::record('[ LOG ] INIT ' . $type . ':' . var_export($config, true), 'info');
APP_DEBUG && Log::record('[ LOG ] INIT ' . $type . ': ' . var_export($config, true), 'info');
}
// 通知初始化
@@ -48,7 +48,7 @@ class Log
unset($config['type']);
self::$alarm = new $class($config['alarm']);
// 记录初始化信息
APP_DEBUG && Log::record('[ CACHE ] ALARM ' . $type . ':' . var_export($config, true), 'info');
APP_DEBUG && Log::record('[ CACHE ] ALARM ' . $type . ': ' . var_export($config, true), 'info');
}
/**
@@ -111,6 +111,7 @@ class Log
/**
* 发送预警通知
* @param mixed $msg 调试信息
* @return void
*/
public static function send($msg)