/** * [init 初始化log配置] 有默认配置 * @return [type] [description] */ public static function init($logInfo = null) { date_default_timezone_set('PRC'); // //判断是否开启task_log // if (!empty($iniArr['log_method'])) { // foreach ($iniArr['log_method'] as $key => $value) { // self::$enable_task_log = ($key == 'enable_task_log' && $value == 1) ? true : false; // } // } if (empty($logInfo)) { return true; } self::$logDir = isset($logInfo['log_path']) ? $logInfo['log_path'] : '/tmp/log'; //log level set array 以用户的为准 self::$logLevel = array(); foreach ($logInfo['log_level'] as $key => $value) { if ($value) { self::$logLevel[$key] = $key; } } return true; }