Skip to content

Add timestamp to console logs#4344

Merged
stefanvanburen merged 3 commits intomainfrom
svanburen/add-timestamp-logging
Feb 25, 2026
Merged

Add timestamp to console logs#4344
stefanvanburen merged 3 commits intomainfrom
svanburen/add-timestamp-logging

Conversation

@stefanvanburen
Copy link
Member

It looks like we dropped this out of the zap logs, way back in #69. @emcfarlane correctly ported the lack of a timestamp over to slog in #3844. This probably made sense when buf was running fairly quick CLI commands, but now that we have various server processes running from buf, it makes sense to add a timestamp for the various logs being emitted. I specifically wanted this when debugging buf lsp serve.

We could just make this optional (only for certain commands), but this feels fairly uncontroversial.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 20, 2026

The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedFeb 24, 2026, 5:32 PM

It looks like we dropped this out of the zap logs, way back in
#69. @emcfarlane correctly ported the lack of a timestamp
over to slog in #3844. This probably made sense when `buf` was running
fairly quick CLI commands, but now that we have various server processes
running from `buf`, it makes sense to add a timestamp for the various
logs being emitted. I specifically wanted this when debugging `buf lsp
serve`.

We _could_ just make this optional (only for certain commands), but this
feels fairly uncontroversial.
@stefanvanburen stefanvanburen force-pushed the svanburen/add-timestamp-logging branch from 82ec0d4 to 6d888c7 Compare February 20, 2026 15:12
Console format was updated, so we want to check for the updated
format. Also, use `t.Context()` in tests instead of
`context.Background()`.
@stefanvanburen stefanvanburen marked this pull request as ready for review February 24, 2026 17:31
@stefanvanburen stefanvanburen merged commit 04dcaf3 into main Feb 25, 2026
10 checks passed
@stefanvanburen stefanvanburen deleted the svanburen/add-timestamp-logging branch February 25, 2026 19:00
stefanvanburen added a commit that referenced this pull request Feb 26, 2026
This reverts commit 04dcaf3.

This doesn't look great in the CLI with our approach to warnings:

Before:

```console
$ buf dep update
WARN    Module buf.build/bufbuild/protovalidate is declared in your buf.yaml deps but is unused. This command only modifies buf.lock files, not buf.yaml files. Please remove buf.build/bufbuild/protovalidate from your buf.yaml deps if it is not needed.
```

After:

```console
$ buf dep update
2026-02-26T16:53:16-05:00       WARN    Module buf.build/bufbuild/protovalidate is declared in your buf.yaml deps but is unused. This command only modifies buf.lock files, not buf.yaml files. Please remove buf.build/bufbuild/protovalidate from your buf.yaml deps if it is not needed.
```

Adds a lot of noise, and we have this sort of thing in examples that we
probably don't want to update (e.g.,
https://protovalidate.com/quickstart/connect-go/#add-protovalidate-dependency).

For now, let's revert, and we could consider adding this as a more
targeted addition to maybe just our server / long-running processes, on
an opt-in basis.
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 this pull request may close these issues.

2 participants