fix #283 (remove unnecessary log.Fatal)

The server should never crash during rehash, even if the config is invalid.
This commit is contained in:
Shivaram Lingamneni 2018-08-06 05:02:47 -04:00
parent a72de2f4d2
commit 3c12fb6254
5 changed files with 45 additions and 34 deletions

View file

@ -124,7 +124,9 @@ func (logger *Manager) ApplyConfig(config []LoggingConfig) error {
stdoutWriteLock: &logger.stdoutWriteLock,
fileWriteLock: &logger.fileWriteLock,
}
if typeMap["userinput"] || typeMap["useroutput"] || (typeMap["*"] && !(excludedTypeMap["userinput"] && excludedTypeMap["useroutput"])) {
ioEnabled := typeMap["userinput"] || typeMap["useroutput"] || (typeMap["*"] && !(excludedTypeMap["userinput"] && excludedTypeMap["useroutput"]))
// raw I/O is only logged at level debug;
if ioEnabled && logConfig.Level == LogDebug {
atomic.StoreUint32(&logger.loggingRawIO, 1)
}
if sLogger.MethodFile.Enabled {
@ -177,13 +179,6 @@ func (logger *Manager) Error(logType string, messageParts ...string) {
logger.Log(LogError, logType, messageParts...)
}
// Fatal logs the given message as an error message, then exits.
func (logger *Manager) Fatal(logType string, messageParts ...string) {
logger.Error(logType, messageParts...)
logger.Error("FATAL", "Fatal error encountered, application exiting")
os.Exit(1)
}
type fileMethod struct {
Enabled bool
Filename string