mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 07:35:34 +08:00
initial commit
This commit is contained in:
18
src/Framework/Logger.php
Normal file
18
src/Framework/Logger.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Framework;
|
||||
|
||||
|
||||
use Swoole\Coroutine\System;
|
||||
|
||||
class Logger
|
||||
{
|
||||
private static function getTimeFormat($type = "I") {
|
||||
return "[" . date("Y-m-d H:i:s") . "]\t[" . $type . "]\t";
|
||||
}
|
||||
|
||||
public static function writeSwooleLog($log) {
|
||||
System::writeFile(CRASH_DIR . "swoole_error.log", "\n" . self::getTimeFormat() . $log, FILE_APPEND);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user