Make the use of dynamic Chronicles outputs more optional

This commit is contained in:
Zahary Karadjov 2019-10-29 05:27:14 +02:00
parent f1ea0cec32
commit 831b562435
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
1 changed files with 4 additions and 6 deletions

View File

@ -905,12 +905,10 @@ when isMainModule:
randomize()
let config = BeaconNodeConf.load(version = fullVersionStr())
doAssert defaultChroniclesStream.outputs.len > 0
doAssert defaultChroniclesStream.output is DynamicOutput
defaultChroniclesStream.output.writer =
proc (logLevel: LogLevel, msg: LogOutputStr) {.gcsafe.} =
stdout.write(msg)
when compiles(defaultChroniclesStream.output.writer):
defaultChroniclesStream.output.writer =
proc (logLevel: LogLevel, msg: LogOutputStr) {.gcsafe.} =
stdout.write(msg)
if config.logLevel != LogLevel.NONE:
setLogLevel(config.logLevel)