Open jakubgs opened 3 years ago
Try -d:chronicles_colors=none
. You might also want -d:chronicles_sinks=json
.
That works, thanks.
Actually, -d:chronicles_colors=none
works as expected, but -d:chronicles_sinks=json
fails with:
[NimScript] exec: nim c --out:build/nimbus -d:chronicles_log_level=TRACE -d:chronicles_sinks=json --verbosity:0 --hints:off -d:chronicles_log_level=TRACE -d:release nimbus/nimbus.nim
/data/nimbus-eth1-mainnet-master/repo/nimbus/vm_compile_info.nim(23, 10) Warning: *** Compiling with nimvm enabled [User]
/data/nimbus-eth1-mainnet-master/repo/vendor/nim-eth/eth/p2p/kademlia.nim(198, 10) template/generic instantiation of `warn` from here
/data/nimbus-eth1-mainnet-master/repo/vendor/nim-chronicles/chronicles.nim(363, 10) template/generic instantiation of `log` from here
/data/nimbus-eth1-mainnet-master/repo/vendor/nim-chronicles/chronicles/log_output.nim(86, 65) template/generic instantiation of `expandItIMPL` from here
/data/nimbus-eth1-mainnet-master/repo/vendor/nim-chronicles/chronicles/log_output.nim(677, 10) template/generic instantiation of `[]=` from here
/data/nimbus-eth1-mainnet-master/repo/vendor/nim-chronicles/chronicles/log_output.nim(652, 15) template/generic instantiation of `writeField` from here
/data/nimbus-eth1-mainnet-master/repo/vendor/nim-json-serialization/json_serialization/writer.nim(72, 4) template/generic instantiation of `writeValue` from here
/data/nimbus-eth1-mainnet-master/repo/vendor/nim-json-serialization/json_serialization/writer.nim(159, 17) template/generic instantiation of `writeValue` from here
/data/nimbus-eth1-mainnet-master/repo/vendor/nim-json-serialization/json_serialization/writer.nim(219, 10) template/generic instantiation of `enumInstanceSerializedFields` from here
/data/nimbus-eth1-mainnet-master/repo/vendor/nim-json-serialization/json_serialization/writer.nim(222, 8) template/generic instantiation of `writeFieldIMPL` from here
/data/nimbus-eth1-mainnet-master/repo/vendor/nim-serialization/serialization/object_serialization.nim(192, 9) template/generic instantiation of `writeValue` from here
/data/nimbus-eth1-mainnet-master/repo/vendor/nim-json-serialization/json_serialization/writer.nim(219, 10) template/generic instantiation of `enumInstanceSerializedFields` from here
/data/nimbus-eth1-mainnet-master/repo/vendor/nim-json-serialization/json_serialization/writer.nim(222, 8) template/generic instantiation of `writeFieldIMPL` from here
/data/nimbus-eth1-mainnet-master/repo/vendor/nim-serialization/serialization/object_serialization.nim(192, 9) template/generic instantiation of `writeValue` from here
/data/nimbus-eth1-mainnet-master/repo/vendor/nim-json-serialization/json_serialization/writer.nim(228, 12) Error: Failed to convert to JSON an unsupported type: PublicKey
stack trace: (most recent call last)
/data/nimbus-eth1-mainnet-master/repo/vendor/nimbus-build-system/vendor/Nim/lib/system/nimscript.nim(416, 18)
/data/nimbus-eth1-mainnet-master/repo/nimbus.nimble(52, 15) nimbusTask
/data/nimbus-eth1-mainnet-master/repo/nimbus.nimble(30, 8) buildBinary
/data/nimbus-eth1-mainnet-master/repo/vendor/nimbus-build-system/vendor/Nim/lib/system/nimscript.nim(260, 7) exec
/data/nimbus-eth1-mainnet-master/repo/vendor/nimbus-build-system/vendor/Nim/lib/system/nimscript.nim(260, 7) Error: unhandled exception: FAILED: nim c --out:build/nimbus -d:chronicles_log_level=TRACE -d:chronicles_sinks=json --verbosity:0 --hints:off -d:chronicles_log_level=TRACE -d:release nimbus/nimbus.nim [OSError]
make: *** [Makefile:110: nimbus] Error 1
Error: Failed to convert to JSON an unsupported type: PublicKey
For my purposes I decided to keep the colours in log files. The files can be viewed with less -R
; I have LESS=R
in my environment to enable that all the time. The terminal codes do interfere with grep
though.
Thanks for the JSON report. We don't use the JSON logging in practice, and most of the "format object as text" functions are defined with Nim $(..)
, which the JSON logging doesn't use. That explains the PublicKey
problem. There may be others, even if it compiles.
I'm configuring this client to run under Systemd and the logs I'm seeing in a file created by rsyslog include colors:
And I see no flag to disable colors: