mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 操作系统平台版本信息
This commit is contained in:
parent
5caf532fd6
commit
7b87dcf0f6
4 changed files with 7 additions and 11 deletions
|
|
@ -248,7 +248,7 @@ func InitConf() {
|
||||||
logging.LogInfof("using Microsoft Store edition")
|
logging.LogInfof("using Microsoft Store edition")
|
||||||
}
|
}
|
||||||
Conf.System.OS = runtime.GOOS
|
Conf.System.OS = runtime.GOOS
|
||||||
Conf.System.OSPlatform, _ = util.GetOSPlatform()
|
Conf.System.OSPlatform = util.GetOSPlatform()
|
||||||
|
|
||||||
if "" != Conf.UserData {
|
if "" != Conf.UserData {
|
||||||
Conf.User = loadUserFromConf()
|
Conf.User = loadUserFromConf()
|
||||||
|
|
|
||||||
|
|
@ -23,11 +23,11 @@ import (
|
||||||
"github.com/siyuan-note/logging"
|
"github.com/siyuan-note/logging"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetOSPlatform() (plat, ver string) {
|
func GetOSPlatform() (plat string) {
|
||||||
plat, _, ver, err := host.PlatformInformation()
|
plat, _, _, err := host.PlatformInformation()
|
||||||
if nil != err {
|
if nil != err {
|
||||||
logging.LogWarnf("get os platform failed: %s", err)
|
logging.LogWarnf("get os platform failed: %s", err)
|
||||||
return "Unknown", ""
|
return "Unknown"
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
package util
|
package util
|
||||||
|
|
||||||
func GetOSPlatform() (plat, ver string) {
|
func GetOSPlatform() (plat string) {
|
||||||
if ContainerIOS == Container {
|
if ContainerIOS == Container {
|
||||||
return "iOS " + MobileOSVer
|
return "iOS " + MobileOSVer
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,11 +46,7 @@ var IsExiting = false
|
||||||
var MobileOSVer string
|
var MobileOSVer string
|
||||||
|
|
||||||
func logBootInfo() {
|
func logBootInfo() {
|
||||||
plat, platVer := GetOSPlatform()
|
plat := GetOSPlatform()
|
||||||
osInfo := plat
|
|
||||||
if "" != platVer {
|
|
||||||
osInfo += " " + platVer
|
|
||||||
}
|
|
||||||
logging.LogInfof("kernel is booting:\n"+
|
logging.LogInfof("kernel is booting:\n"+
|
||||||
" * ver [%s]\n"+
|
" * ver [%s]\n"+
|
||||||
" * arch [%s]\n"+
|
" * arch [%s]\n"+
|
||||||
|
|
@ -62,7 +58,7 @@ func logBootInfo() {
|
||||||
" * container [%s]\n"+
|
" * container [%s]\n"+
|
||||||
" * database [ver=%s]\n"+
|
" * database [ver=%s]\n"+
|
||||||
" * workspace directory [%s]",
|
" * workspace directory [%s]",
|
||||||
Ver, runtime.GOARCH, osInfo, os.Getpid(), Mode, WorkingDir, ReadOnly, Container, DatabaseVer, WorkspaceDir)
|
Ver, runtime.GOARCH, plat, os.Getpid(), Mode, WorkingDir, ReadOnly, Container, DatabaseVer, WorkspaceDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
func IsMutexLocked(m *sync.Mutex) bool {
|
func IsMutexLocked(m *sync.Mutex) bool {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue