Skip to content

raindex_cli logs have no timestamps (.without_time() in crates/cli/src/main.rs) #2822

Description

@thedavidmeister

raindex_cli emits log lines with no timestamp, which defeats reviewing errors after the fact — the thing logs are kept for.

Where

crates/cli/src/main.rs:22-29 builds the subscriber for the raindex_cli binary:

tracing_subscriber::fmt()
    .with_env_filter(filter)
    .with_thread_names(false)
    .with_thread_ids(false)
    .with_target(false)
    .without_time()      // <- line 27
    .compact()
    .init();

.without_time() is the only line here that removes information a reader can't recover. with_thread_names/with_thread_ids/with_target all trade verbosity for noise reduction and are defensible; a timestamp is what lets you correlate a captured log with an on-chain tx, an RPC outage, or a user's "it broke around 3pm".

The inconsistency

The other CLI entrypoint in the same workspace does the opposite. crates/quote/src/cli/mod.rs:143:

tracing::subscriber::set_global_default(tracing_subscriber::fmt::Subscriber::new())?;

fmt::Subscriber::new() keeps timestamps by default. So two binaries in one workspace disagree on whether a log line is timestamped, and neither choice is written down anywhere — nothing in README.md, CLAUDE.md, or AGENTS.md mentions logging, RUST_LOG, or log capture at all.

Proposed fix

Drop .without_time() from crates/cli/src/main.rs, so raindex_cli matches the quote CLI and the tracing_subscriber default.

If the compact single-line format is the reason it was removed, .with_timer(tracing_subscriber::fmt::time::UtcTime::rfc_3339()) (or ChronoUtc) keeps it short and unambiguous across timezones, which matters because captured logs get pasted into issues by people in different places.

Either way the two entrypoints should agree, and the choice should be deliberate rather than a side effect of one file being written with .compact() in mind.

How to tell it worked

raindex_cli <any subcommand> 2>&1 | head -1 carries a parseable timestamp; today it does not.

Context

Found while ruling on #843 ("need to be able to get logs out of the app somehow"). That issue is closed — logs do come out, on stderr, redirectable with 2> log.txt. This is the narrower thing that is actually still wrong with them.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions