mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08: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:
parent
a72de2f4d2
commit
3c12fb6254
5 changed files with 45 additions and 34 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue