Slightly changed CRITICAL's error message format

This commit is contained in:
Nocturn9x 2021-12-02 19:03:10 +01:00
parent 5c2515c3a7
commit b01da7eada
1 changed files with 4 additions and 2 deletions

View File

@ -109,9 +109,11 @@ proc getDefaultLogger*(): Logger =
proc logFatal(self: LogHandler, logger: Logger, message: string) = proc logFatal(self: LogHandler, logger: Logger, message: string) =
setForegroundColor(fgBlack) setForegroundColor(fgBlack)
setBackgroundColor(bgRed) setBackgroundColor(bgRed)
stderr.writeLine(&"""[{fromUnix(getTime().toUnixFloat().int).format("d/M/yyyy HH:mm:ss")} - FATAL] {message}""") stderr.write(&"""[{fromUnix(getTime().toUnixFloat().int).format("d/M/yyyy HH:mm:ss")} - FATAL]""")
setForegroundColor(fgDefault) setForegroundColor(fgRed)
setBackgroundColor(bgDefault) setBackgroundColor(bgDefault)
stderr.writeline(&" {message}")
setForegroundColor(fgDefault)
result = newLogger() result = newLogger()
result.addHandler(createHandler(logTrace, LogLevel.Trace)) result.addHandler(createHandler(logTrace, LogLevel.Trace))