This commit is contained in:
Liang Ding 2023-03-27 11:47:38 +08:00
parent f534675464
commit a85c61d3c1
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
7 changed files with 57 additions and 39 deletions

View file

@ -174,14 +174,23 @@ func ExportSystemLog() (zipPath string) {
logging.LogErrorf("copy app log from [%s] to [%s] failed: %s", err, appLog, to)
}
}
kernelLog := filepath.Join(util.TempDir, "siyuan.log")
kernelLog := filepath.Join(util.HomeDir, ".config", "siyuan", "kernel.log")
if gulu.File.IsExist(kernelLog) {
to := filepath.Join(exportFolder, "siyuan.log")
to := filepath.Join(exportFolder, "kernel.log")
if err := gulu.File.CopyFile(kernelLog, to); nil != err {
logging.LogErrorf("copy kernel log from [%s] to [%s] failed: %s", err, kernelLog, to)
}
}
siyuanLog := filepath.Join(util.TempDir, "siyuan.log")
if gulu.File.IsExist(siyuanLog) {
to := filepath.Join(exportFolder, "siyuan.log")
if err := gulu.File.CopyFile(siyuanLog, to); nil != err {
logging.LogErrorf("copy kernel log from [%s] to [%s] failed: %s", err, siyuanLog, to)
}
}
zipPath = exportFolder + ".zip"
zip, err := gulu.Zip.Create(zipPath)
if nil != err {