mirror of
https://github.com/vacp2p/universal-connectivity.git
synced 2026-01-09 07:08:04 -05:00
fix: nim build (#333)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
when withDir(thisDir(), system.fileExists("nimble.paths")):
|
||||
include "nimble.paths"
|
||||
--define:
|
||||
"chronicles_sinks=textblocks[dynamic]"
|
||||
"chronicles_sinks=json[dynamic]"
|
||||
--define:
|
||||
"chronicles_log_level=DEBUG"
|
||||
# end Nimble config
|
||||
|
||||
@@ -82,6 +82,24 @@ proc start(
|
||||
# Handle Ctrl+C
|
||||
setControlCHook(cleanup)
|
||||
|
||||
# Pick the correct string type for your Chronicles version
|
||||
when declared(OutStr):
|
||||
type WriterStr = OutStr
|
||||
else:
|
||||
type WriterStr = LogOutputStr
|
||||
|
||||
# Early (bootstrap) writer: mirror logs to stdout so nothing is dropped
|
||||
defaultChroniclesStream.output.writer =
|
||||
proc (lvl: LogLevel, rec: WriterStr) {.closure, gcsafe, raises: [].} =
|
||||
let s = cast[string](rec)
|
||||
try:
|
||||
for line in s.splitLines():
|
||||
stdout.writeLine(line)
|
||||
stdout.flushFile()
|
||||
except IOError:
|
||||
discard
|
||||
|
||||
|
||||
var rng = newRng()
|
||||
|
||||
let switch =
|
||||
|
||||
Reference in New Issue
Block a user