mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-13 06:43:52 +00:00
committed by
Andreas Rumpf
parent
9c99973ff8
commit
0874c649e9
@@ -153,8 +153,11 @@ method log*(logger: ConsoleLogger, level: Level, args: varargs[string, `$`]) =
|
||||
let cln: cstring = ln
|
||||
{.emit: "console.log(`cln`);".}
|
||||
else:
|
||||
writeLine(stdout, ln)
|
||||
if level in {lvlError, lvlFatal}: flushFile(stdout)
|
||||
try:
|
||||
writeLine(stdout, ln)
|
||||
if level in {lvlError, lvlFatal}: flushFile(stdout)
|
||||
except IOError:
|
||||
discard
|
||||
|
||||
proc newConsoleLogger*(levelThreshold = lvlAll, fmtStr = defaultFmtStr): ConsoleLogger =
|
||||
## Creates a new console logger. This logger logs to the console.
|
||||
|
||||
Reference in New Issue
Block a user