fix: logging improved

This commit is contained in:
evilsocket 2018-01-09 14:21:34 +01:00
commit 10b05dd0eb
3 changed files with 12 additions and 6 deletions

View file

@ -111,12 +111,15 @@ func (p *EventPool) Log(level int, format string, args ...interface{}) {
return
}
message := fmt.Sprintf(format, args)
p.Add("sys.log", LogMessage{
level,
fmt.Sprintf(format, args...),
message,
})
if level == FATAL {
fmt.Fprintf(os.Stderr, "%s\n", message)
os.Exit(1)
}
}