diff --git a/library/think/Log.php b/library/think/Log.php index 943e78c8..413e2761 100644 --- a/library/think/Log.php +++ b/library/think/Log.php @@ -84,6 +84,10 @@ class Log public static function record($msg, $type = 'log') { self::$log[$type][] = $msg; + if (IS_CLI && count(self::$log[$type]) > 100) { + // 命令行下面日志写入改进 + self::save(); + } } /**