Skip to content

Better indicate which log entries are repeated #22

Open
@RalfJung

Description

@RalfJung

(I am not a direct user of this crate but involved via reviewing rust-lang/rust#75143, which will make Miri use this crate)

@oli-obk pointed me to this example of how the crate repeats log entries when subtrees start and end. However, I find it hard to tell which of these are new information vs. repeating old information to increase readability. I made a proposal but I am not sure if that's actually all that much better...

FWIW, Miri already does something like this kind of repetition, and translated back to tracing-tree that would look something like this:

1:mainbasic::hierarchical-example{version=0.1}
1:main├┐basic::hierarchical-example{version=0.1}
1:main│└┐basic::server{host="localhost", port=8080}
1:main│ ├─ms INFO basic starting
1:main│ ├─ms INFO basic listening
1:main│ ├┐PAUSING basic::server{host="localhost", port=8080}
1:main│ │└┐basic::conn{peer_addr="82.9.9.9", port=42381}
1:main│ │ ├─ms DEBUG basic connected
1:main│ │ ├─ms DEBUG basic message received, length=2
1:main│ │┌┘ENDING basic::conn{peer_addr="82.9.9.9", port=42381}
1:main│ ├┘CONTINUING basic::server{host="localhost", port=8080}
1:main│ ├┐PAUSING basic::server{host="localhost", port=8080}
1:main│ │└┐basic::conn{peer_addr="8.8.8.8", port=18230}
1:main│ │ ├─ms DEBUG basic connected
1:main│ │┌┘ENDING basic::conn{peer_addr="8.8.8.8", port=18230}
1:main│ ├┘CONTINUING basic::server{host="localhost", port=8080}
1:main│ ├┐PAUSING basic::server{host="localhost", port=8080}
1:main│ │└┐basic::conn{peer_addr="82.9.9.9", port=42381}
1:main│ │ ├─ms WARN basic weak encryption requested, algo="xor"
1:main│ │ ├─ms DEBUG basic response sent, length=8
1:main│ │ ├─ms DEBUG basic disconnected
1:main│ │┌┘ENDING basic::conn{peer_addr="82.9.9.9", port=42381}
1:main│ ├┘CONTINUING basic::server{host="localhost", port=8080}
1:main│ ├┐PAUSING basic::server{host="localhost", port=8080}
1:main│ │└┐basic::conn{peer_addr="8.8.8.8", port=18230}
1:main│ │ ├─ms DEBUG basic message received, length=5
1:main│ │ ├─ms DEBUG basic response sent, length=8
1:main│ │ ├─ms DEBUG basic disconnected
1:main│ │┌┘ENDING basic::conn{peer_addr="8.8.8.8", port=18230}
1:main│ ├┘CONTINUING basic::server{host="localhost", port=8080}
1:main│ ├─ms WARN basic internal error
1:main│ ├─ms INFO basic exit
1:main│┌┘ENDING basic::server{host="localhost", port=8080}
1:main├┘ENDING basic::hierarchical-example{version=0.1}
1:mainbasic::hierarchical-example{version=0.1}

In fact Miri also prints something like STARTING when the subtree starts, but I am less sure about that.

There are probably better ways to do this, but I find the current rendering hard to interpret.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions