调试模式 关闭字段缓存 取消app类的日志初始化和缓存初始化 改为使用的时候自动初始化

This commit is contained in:
thinkphp
2016-01-23 13:10:35 +08:00
parent bd14a7c328
commit ac0547e36b
4 changed files with 24 additions and 14 deletions

View File

@@ -76,7 +76,10 @@ class Log
*/
public static function save()
{
self::$driver && self::$driver->save(self::$log);
if (is_null(self::$driver)) {
self::init(Config::get('log'));
}
self::$driver->save(self::$log);
}
/**
@@ -95,8 +98,11 @@ class Log
// 监听log_write
APP_HOOK && Hook::listen('log_write', $log);
if (is_null(self::$driver)) {
self::init(Config::get('log'));
}
// 写入日志
self::$driver && self::$driver->save($log);
self::$driver->save($log);
}
/**