🎨 Add mobile.log file to diagnose mobile issues https://github.com/siyuan-note/siyuan/issues/10270

This commit is contained in:
Daniel 2024-01-28 14:28:46 +08:00
parent c76b1f3252
commit 8c5f8d2bc4
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
5 changed files with 15 additions and 4 deletions

View file

@ -54,7 +54,7 @@ require (
github.com/siyuan-note/dejavu v0.0.0-20240124091649-941e2960dc74
github.com/siyuan-note/encryption v0.0.0-20231219001248-1e028a4d13b4
github.com/siyuan-note/eventbus v0.0.0-20240124091459-8e1b37a55255
github.com/siyuan-note/filelock v0.0.0-20240121150730-38e4487651d1
github.com/siyuan-note/filelock v0.0.0-20240128062546-4cf460a2732a
github.com/siyuan-note/httpclient v0.0.0-20240105083729-70d0557bc690
github.com/siyuan-note/logging v0.0.0-20231208035918-61f884c854f0
github.com/siyuan-note/riff v0.0.0-20231226152006-8833f8b9a6c1

View file

@ -358,8 +358,8 @@ github.com/siyuan-note/encryption v0.0.0-20231219001248-1e028a4d13b4 h1:kJaw5L/e
github.com/siyuan-note/encryption v0.0.0-20231219001248-1e028a4d13b4/go.mod h1:UYcCCY+0wh+GmUoDOaO63j1sV5lgy7laLAk1XhEiUis=
github.com/siyuan-note/eventbus v0.0.0-20240124091459-8e1b37a55255 h1:WTAUBlU2v7ISet9ankbjqZrRKo6MLGK1LBmDyNlehPY=
github.com/siyuan-note/eventbus v0.0.0-20240124091459-8e1b37a55255/go.mod h1:1/nGgthl89FPA7GzAcEWKl6zRRnfgyTjzLZj9bW7kuw=
github.com/siyuan-note/filelock v0.0.0-20240121150730-38e4487651d1 h1:eNHKiqE5yPnj1PYk0PJhxP+oqWdKi+0ZI28lBQmz5qg=
github.com/siyuan-note/filelock v0.0.0-20240121150730-38e4487651d1/go.mod h1:CYJQjSyKYLhEJJC+5I+R4uNcpyW0X2CaUYwMVbkelDk=
github.com/siyuan-note/filelock v0.0.0-20240128062546-4cf460a2732a h1:77b+pJn6eb905MMGKynV/OJBzSkNfh96QUnpzgT7v18=
github.com/siyuan-note/filelock v0.0.0-20240128062546-4cf460a2732a/go.mod h1:CYJQjSyKYLhEJJC+5I+R4uNcpyW0X2CaUYwMVbkelDk=
github.com/siyuan-note/httpclient v0.0.0-20240105083729-70d0557bc690 h1:r7qWSaYQhomCAdQl/dZe4NdAn1zadytb4jcOeopdHw4=
github.com/siyuan-note/httpclient v0.0.0-20240105083729-70d0557bc690/go.mod h1:ZWp+cGHwkXXCIYudLUxI9AV2IcbsgPGhQVL/1SqUxQg=
github.com/siyuan-note/logging v0.0.0-20231208035918-61f884c854f0 h1:+XjUr9UMXsczdO2bGA72p/k9wa2ShPb8ybi7CDBJ7HQ=

View file

@ -84,6 +84,10 @@ func SetHttpServerPort(port int) {
filelock.AndroidServerPort = port
}
func GetCurrentWorkspacePath() string {
return util.WorkspaceDir
}
func SetTimezone(container, appDir, timezoneID string) {
if "ios" == container {
os.Setenv("ZONEINFO", filepath.Join(appDir, "app", "zoneinfo.zip"))

View file

@ -328,6 +328,14 @@ func ExportSystemLog() (zipPath string) {
}
}
mobileLog := filepath.Join(util.TempDir, "mobile.log")
if gulu.File.IsExist(mobileLog) {
to := filepath.Join(exportFolder, "mobile.log")
if err := filelock.Copy(mobileLog, to); nil != err {
logging.LogErrorf("copy mobile log from [%s] to [%s] failed: %s", err, mobileLog, to)
}
}
zipPath = exportFolder + ".zip"
zip, err := gulu.Zip.Create(zipPath)
if nil != err {

View file

@ -50,7 +50,6 @@ func BootMobile(container, appDir, workspaceBaseDir, lang string) {
logging.LogErrorf("create user home conf folder [%s] failed: %s", userHomeConfDir, err)
os.Exit(logging.ExitCodeInitWorkspaceErr)
}
}
defaultWorkspaceDir := filepath.Join(workspaceBaseDir, "siyuan")