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) =
setForegroundColor(fgBlack)
setBackgroundColor(bgRed)
stderr.writeLine(&"""[{fromUnix(getTime().toUnixFloat().int).format("d/M/yyyy HH:mm:ss")} - FATAL] {message}""")
setForegroundColor(fgDefault)
stderr.write(&"""[{fromUnix(getTime().toUnixFloat().int).format("d/M/yyyy HH:mm:ss")} - FATAL]""")
setForegroundColor(fgRed)
setBackgroundColor(bgDefault)
stderr.writeline(&" {message}")
setForegroundColor(fgDefault)
result = newLogger()
result.addHandler(createHandler(logTrace, LogLevel.Trace))