parent
9c99973ff8
commit
0874c649e9
1 changed files with 5 additions and 2 deletions
|
|
@ -153,8 +153,11 @@ method log*(logger: ConsoleLogger, level: Level, args: varargs[string, `$`]) =
|
||||||
let cln: cstring = ln
|
let cln: cstring = ln
|
||||||
{.emit: "console.log(`cln`);".}
|
{.emit: "console.log(`cln`);".}
|
||||||
else:
|
else:
|
||||||
writeLine(stdout, ln)
|
try:
|
||||||
if level in {lvlError, lvlFatal}: flushFile(stdout)
|
writeLine(stdout, ln)
|
||||||
|
if level in {lvlError, lvlFatal}: flushFile(stdout)
|
||||||
|
except IOError:
|
||||||
|
discard
|
||||||
|
|
||||||
proc newConsoleLogger*(levelThreshold = lvlAll, fmtStr = defaultFmtStr): ConsoleLogger =
|
proc newConsoleLogger*(levelThreshold = lvlAll, fmtStr = defaultFmtStr): ConsoleLogger =
|
||||||
## Creates a new console logger. This logger logs to the console.
|
## Creates a new console logger. This logger logs to the console.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue