Skip to content

Commit

Permalink
Fix logs not being printed (#38)
Browse files Browse the repository at this point in the history
* Fix logs not being printed.

* Pass a constant to SetLevel instead of parsing a string.
  • Loading branch information
stasatdaglabs authored Jul 6, 2021
1 parent 8ef7aa6 commit cdacdc6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions log.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,18 @@ func initLog(logFile, errLogFile string) {
fmt.Fprintf(os.Stderr, "Error adding log file %s as log rotator for level %s: %s", errLogFile, logger.LevelWarn, err)
os.Exit(1)
}

err = backendLog.AddLogWriter(os.Stdout, logger.LevelInfo)
if err != nil {
fmt.Fprintf(os.Stderr, "Error adding stdout to the loggerfor level %s: %s", logger.LevelWarn, err)
os.Exit(1)
}

err = backendLog.Run()
if err != nil {
fmt.Fprintf(os.Stderr, "Error starting the logger: %s ", err)
os.Exit(1)
}

log.SetLevel(logger.LevelDebug)
}

0 comments on commit cdacdc6

Please sign in to comment.