embed: error when it cannot find journal socket

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
Gyuho Lee
2018-05-16 14:25:10 -07:00
parent 1e953bd187
commit 5a61dc8008
3 changed files with 14 additions and 5 deletions

View File

@ -225,7 +225,11 @@ func (cfg *Config) setupLogging() error {
}
// use stderr as fallback
syncer := getZapWriteSyncer()
syncer, lerr := getJournalWriteSyncer()
if lerr != nil {
return lerr
}
lvl := zap.NewAtomicLevelAt(zap.InfoLevel)
if cfg.Debug {
lvl = zap.NewAtomicLevelAt(zap.DebugLevel)