mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-01 06:18:49 +01:00
🎨 记录操作系统平台
This commit is contained in:
parent
2a4fc32e50
commit
08641595ae
4 changed files with 14 additions and 9 deletions
|
|
@ -236,7 +236,7 @@ func InitConf() {
|
|||
logging.LogInfof("using Microsoft Store edition")
|
||||
}
|
||||
Conf.System.OS = runtime.GOOS
|
||||
Conf.System.OSPlatform = util.GetOSPlatform()
|
||||
Conf.System.OSPlatform, _ = util.GetOSPlatform()
|
||||
Conf.Newbie = util.IsNewbie
|
||||
|
||||
if "" != Conf.UserData {
|
||||
|
|
|
|||
|
|
@ -23,11 +23,11 @@ import (
|
|||
"github.com/siyuan-note/logging"
|
||||
)
|
||||
|
||||
func GetOSPlatform() (ret string) {
|
||||
ret, _, _, err := host.PlatformInformation()
|
||||
func GetOSPlatform() (plat, ver string) {
|
||||
plat, _, ver, err := host.PlatformInformation()
|
||||
if nil != err {
|
||||
logging.LogWarnf("get os platform failed: %s", err)
|
||||
return "Unknown"
|
||||
return "Unknown", ""
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@
|
|||
|
||||
package util
|
||||
|
||||
func GetOSPlatform() (ret string) {
|
||||
func GetOSPlatform() (plat, ver string) {
|
||||
if ContainerIOS == Container {
|
||||
return "iOS"
|
||||
return "iOS", ""
|
||||
}
|
||||
if ContainerAndroid == Container {
|
||||
return "Android"
|
||||
return "Android", ""
|
||||
}
|
||||
return "Unknown"
|
||||
return "Unknown", ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,11 @@ const (
|
|||
var IsExiting = false
|
||||
|
||||
func logBootInfo() {
|
||||
plat, platVer := GetOSPlatform()
|
||||
osInfo := plat
|
||||
if "" != platVer {
|
||||
osInfo += "/" + platVer
|
||||
}
|
||||
logging.LogInfof("kernel is booting:\n"+
|
||||
" * ver [%s]\n"+
|
||||
" * arch [%s]\n"+
|
||||
|
|
@ -57,7 +62,7 @@ func logBootInfo() {
|
|||
" * container [%s]\n"+
|
||||
" * database [ver=%s]\n"+
|
||||
" * workspace directory [%s]",
|
||||
Ver, runtime.GOARCH, GetOSPlatform(), os.Getpid(), Mode, WorkingDir, ReadOnly, Container, DatabaseVer, WorkspaceDir)
|
||||
Ver, runtime.GOARCH, osInfo, os.Getpid(), Mode, WorkingDir, ReadOnly, Container, DatabaseVer, WorkspaceDir)
|
||||
}
|
||||
|
||||
func IsMutexLocked(m *sync.Mutex) bool {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue