ouroboros-network
ouroboros-network copied to clipboard
Cardano-ping output incorrect JSON when it fails to connect
As discussed in this cardano-cli issue, the cardano-cli ping command only outputs ] } when it fails to run with -j flag.
It seems the issue comes from this code, when there's no LogMsg emitted and only a LogEnd received.
It seems to me it would be more robust to:
- provide more "domain specific" logging messages containing the needed information
- output one JSON object per
LogMsgper line
I am happy to provide a patch for this but not sure if I am not missing something?
In any case, it would be great if we could avoid outputting those spurious endings.
@karknu WDYT?
I agree that this should be fixed so that cardano-ping spits out valid json even when it fails to connect. Please create a PR.