mirror of
https://github.com/Monibuca/engine.git
synced 2025-10-16 21:51:25 +08:00
开发提交
This commit is contained in:
@@ -5,6 +5,7 @@ package util
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"runtime"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
@@ -14,7 +15,10 @@ func init() {
|
||||
log.Println("服务启动出错", "打开异常日志文件失败", err)
|
||||
return
|
||||
}
|
||||
|
||||
// 将进程标准出错重定向至文件,进程崩溃时运行时将向该文件记录协程调用栈信息
|
||||
syscall.Dup2(int(logFile.Fd()), int(os.Stderr.Fd()))
|
||||
if runtime.GOARCH == "arm64" {
|
||||
syscall.Dup3(int(logFile.Fd()), int(os.Stderr.Fd()), 0)
|
||||
} else {
|
||||
syscall.Dup2(int(logFile.Fd()), int(os.Stderr.Fd()))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user