Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output errors on a single line if backtraces are disabled #1529

Closed
5 tasks done
Tracked by #1538 ...
romac opened this issue Nov 2, 2021 · 0 comments · Fixed by #1514
Closed
5 tasks done
Tracked by #1538 ...

Output errors on a single line if backtraces are disabled #1529

romac opened this issue Nov 2, 2021 · 0 comments · Fixed by #1514
Assignees
Milestone

Comments

@romac
Copy link
Member

romac commented Nov 2, 2021

Crate

ibc-relayer-cli

Summary

In the presence of errors, the current logs (below) do not look great and are difficult to parse and work with both for humans and programmatically. To improve their usefulness and legibility we should ensure that each log output is emitted as a single line.

Problem Definition

In the presence of errors, the logs emitted by Hermes are subpar for a long-running command-line tool, and are less than useful for operators, especially when working with the logs programmatically or when using tools like grep.

2021-10-27T22:00:13.861230Z ERROR ThreadId(27) [ibc-0] failed to collect events:
   0: WebSocket driver failed
   1:
   1:    0: web socket error: failed to read from WebSocket connection
   1:    1: WebSocket protocol error: Connection reset without closing handshake

   1: Location:
   1:    /Users/coromac/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/flex-error-0.4.4/src/tracer_impl/eyre.rs:10

   1:   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1:                                 ⋮ 10 frames hidden ⋮

...

Proposal

When Hermes is not connected to an interactive terminal (ie. a tty), for example because the logs are streamed to a file or some other service that operators may be using, ensure errors are emitted on a single line and do not include a backtrace.

Acceptance Criteria

Errors in logs look like this when Hermes is not connected to a tty:

2021-10-27T22:01:37.228355Z ERROR ThreadId(27) [ibc-0] failed to collect events: WebSocket driver failed: web socket error: failed to read from WebSocket connection: WebSocket protocol error: Connection reset without closing handshake

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@romac romac self-assigned this Nov 2, 2021
@romac romac added this to the 11.2021 milestone Nov 2, 2021
@romac romac added the P-medium label Nov 2, 2021
@romac romac changed the title Output errors on a single line if ANSI output is disabled Output errors on a single line if backtraces are disabled Nov 10, 2021
@romac romac mentioned this issue Nov 11, 2021
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant