cmd: refactoring Run function

So it's easier, more clear, more isolation between code on non-mobile
and mobile platforms.
This commit is contained in:
Cuong Manh Le
2023-09-19 16:29:01 +00:00
committed by Cuong Manh Le
parent 507c1afd59
commit bed7435b0c
4 changed files with 53 additions and 35 deletions
+5 -3
View File
@@ -35,6 +35,7 @@ var (
mainLog atomic.Pointer[zerolog.Logger]
consoleWriter zerolog.ConsoleWriter
noConfigStart bool
)
func init() {
@@ -65,7 +66,8 @@ func normalizeLogFilePath(logFilePath string) string {
return filepath.Join(dir, logFilePath)
}
func InitConsoleLogging() {
// initConsoleLogging initializes console logging, then storing to mainLog.
func initConsoleLogging() {
consoleWriter = zerolog.NewConsoleWriter(func(w *zerolog.ConsoleWriter) {
w.TimeFormat = time.StampMilli
})
@@ -84,8 +86,8 @@ func InitConsoleLogging() {
}
}
// InitLogging initializes global logging setup.
func InitLogging() {
// initLogging initializes global logging setup.
func initLogging() {
initLoggingWithBackup(true)
}