Commit 7557dbc4 by 杨昕

code format

parent 47a74092
Pipeline #10040 passed with stages
in 33 seconds
......@@ -85,27 +85,6 @@ function http_request_code($url, $isHearder = null, $post = 'GET', $data = null,
return $result;
}
//添加日志
function addLog($content, int $level = 0)
{
$levelArr = ['info', 'warn', 'error'];
//准备数据
$data = [
'app' => 'center-cloud',
'content' => $content,
'level' => $levelArr[$level],
'create_time' => date('Y-m-d H:i:s', time())
];
$date = date('Y-m-d');
$path = "/data/logs/center-cloud{$date}.json";
file_put_contents($path, json_encode($data, JSON_UNESCAPED_UNICODE), FILE_APPEND);
}
/**
* 记录本地日志
* @param $content
......@@ -138,7 +117,7 @@ function getIp()
$clientIP = $_SERVER['REMOTE_ADDR'];
}
addLog($_SERVER);
// addLog($_SERVER);
return $clientIP;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment