Skip to content

Commit 5faaa4d

Browse files
committed
use slog time format for humanizing logs
1 parent ef3deb7 commit 5faaa4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cli/support.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ func humanizeAgentLogs(ls []codersdk.WorkspaceAgentLog) string {
169169
tw := tabwriter.NewWriter(&buf, 0, 2, 1, ' ', 0)
170170
for _, l := range ls {
171171
_, _ = fmt.Fprintf(tw, "%s\t[%s]\t%s\n",
172-
l.CreatedAt.Format(time.RFC3339),
172+
l.CreatedAt.Format("2006-01-02 15:04:05.000"), // for consistency with slog
173173
string(l.Level),
174174
l.Output,
175175
)
@@ -183,7 +183,7 @@ func humanizeBuildLogs(ls []codersdk.ProvisionerJobLog) string {
183183
tw := tabwriter.NewWriter(&buf, 0, 2, 1, ' ', 0)
184184
for _, l := range ls {
185185
_, _ = fmt.Fprintf(tw, "%s\t[%s]\t%s\t%s\t%s\n",
186-
l.CreatedAt.Format(time.RFC3339),
186+
l.CreatedAt.Format("2006-01-02 15:04:05.000"), // for consistency with slog
187187
string(l.Level),
188188
string(l.Source),
189189
l.Stage,

0 commit comments

Comments
 (0)