mirror of
https://github.com/jeremyd/ergo.git
synced 2026-07-10 10:28:10 -07:00
fix #283 (remove unnecessary log.Fatal)
The server should never crash during rehash, even if the config is invalid.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user