1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-20 02:57:05 +00:00

config: Replace robfig with envconfig for #86

- Initial envconfig system is working, not bulletproof.
- Added sane defaults for required parameters.
This commit is contained in:
James Hillyerd
2018-03-21 20:44:47 -07:00
parent be940dd2bc
commit 845cbedc0d
20 changed files with 190 additions and 399 deletions

View File

@@ -72,7 +72,7 @@ func SetLogLevel(level string) (ok bool) {
case "TRACE":
MaxLevel = TRACE
default:
Errorf("Unknown log level requested: " + level)
golog.Print("Error, unknown log level requested: " + level)
return false
}
return true
@@ -150,7 +150,6 @@ func openLogFile() error {
return fmt.Errorf("failed to create %v: %v", logfname, err)
}
golog.SetOutput(logf)
Tracef("Opened new logfile")
// Platform specific
reassignStdout()
return nil
@@ -158,7 +157,6 @@ func openLogFile() error {
// closeLogFile closes the current logfile
func closeLogFile() {
Tracef("Closing logfile")
// We are never in a situation where we can do anything about failing to close
_ = logf.Close()
}