mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-19 13:32:24 +00:00
Core crash report
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
This commit is contained in:
parent
9b58277945
commit
c21ed90da0
1 changed files with 6 additions and 0 deletions
|
@ -226,6 +226,7 @@ func (p *process) Start() (err error) {
|
|||
if err != nil {
|
||||
logger.Error("Failure in running xray-core:", err)
|
||||
p.exitErr = err
|
||||
p.witeCrachReport(err)
|
||||
}
|
||||
}()
|
||||
|
||||
|
@ -241,3 +242,8 @@ func (p *process) Stop() error {
|
|||
}
|
||||
return p.cmd.Process.Signal(syscall.SIGTERM)
|
||||
}
|
||||
|
||||
func (p *process) witeCrachReport(err error) error {
|
||||
crashReportPath := config.GetBinFolderPath() + "/core_crash_" + time.Now().Format("20060102_150405") + ".log"
|
||||
return os.WriteFile(crashReportPath, []byte(err.Error()), os.ModePerm)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue