Skip to content

Commit

Permalink
Fixes chronicles log output
Browse files Browse the repository at this point in the history
  • Loading branch information
benbierens committed Sep 10, 2024
1 parent 9433d9f commit 7da8c04
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions tools/cirdl/cirdl.nim
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,18 @@ import pkg/zip/zipfiles
import pkg/chronos/apps/http/httpclient
import ../../codex/contracts/marketplace

## TODO: chronicles is still "Log message not delivered: [Chronicles] A writer was not configured for a dynamic log output device"
## And I am mildly annoyed by this.
defaultChroniclesStream.outputs[0].writer =
proc (logLevel: LogLevel, msg: LogOutputStr) {.gcsafe.} =
echo msg
proc consoleLog(logLevel: LogLevel, msg: LogOutputStr) {.gcsafe.} =
try:
stdout.write(msg)
stdout.flushFile()
except IOError as err:
logLoggingFailure(cstring(msg), err)

proc noOutput(logLevel: LogLevel, msg: LogOutputStr) = discard

defaultChroniclesStream.outputs[0].writer = consoleLog
defaultChroniclesStream.outputs[1].writer = noOutput
defaultChroniclesStream.outputs[2].writer = noOutput

proc printHelp() =
info "Usage: ./cirdl [circuitPath] [rpcEndpoint] [marketplaceAddress]"
Expand Down

0 comments on commit 7da8c04

Please sign in to comment.