mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-09-17 01:45:27 +02:00
cmd/ctrld: remove prefix main field
While at it, also make init logging with empty log path when running start command. Updates #55
This commit is contained in:
@@ -207,7 +207,11 @@ func initCLI() {
|
|||||||
log.Fatalf("failed to unmarshal config: %v", err)
|
log.Fatalf("failed to unmarshal config: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logPath := cfg.Service.LogPath
|
||||||
|
cfg.Service.LogPath = ""
|
||||||
initLogging()
|
initLogging()
|
||||||
|
cfg.Service.LogPath = logPath
|
||||||
|
|
||||||
processCDFlags()
|
processCDFlags()
|
||||||
// On Windows, the service will be run as SYSTEM, so if ctrld start as Admin,
|
// On Windows, the service will be run as SYSTEM, so if ctrld start as Admin,
|
||||||
// the user home dir is different, so pass specific arguments that relevant here.
|
// the user home dir is different, so pass specific arguments that relevant here.
|
||||||
|
|||||||
+1
-1
@@ -80,7 +80,7 @@ func initLogging() {
|
|||||||
})
|
})
|
||||||
writers = append(writers, consoleWriter)
|
writers = append(writers, consoleWriter)
|
||||||
multi := zerolog.MultiLevelWriter(writers...)
|
multi := zerolog.MultiLevelWriter(writers...)
|
||||||
mainLog = mainLog.Output(multi).With().Timestamp().Str("prefix", "main").Logger()
|
mainLog = mainLog.Output(multi).With().Timestamp().Logger()
|
||||||
if verbose > 0 || isLog {
|
if verbose > 0 || isLog {
|
||||||
proxyLog = proxyLog.Output(multi).With().Timestamp().Logger()
|
proxyLog = proxyLog.Output(multi).With().Timestamp().Logger()
|
||||||
// TODO: find a better way.
|
// TODO: find a better way.
|
||||||
|
|||||||
Reference in New Issue
Block a user