Skip to content
Prev Previous commit
Next Next commit
use slog time format for humanizing logs
  • Loading branch information
johnstcn committed Mar 1, 2024
commit facd04d2fe5ff6cb9e9c66a5656eb56459b8a57c
4 changes: 2 additions & 2 deletions cli/support.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func humanizeAgentLogs(ls []codersdk.WorkspaceAgentLog) string {
tw := tabwriter.NewWriter(&buf, 0, 2, 1, ' ', 0)
for _, l := range ls {
_, _ = fmt.Fprintf(tw, "%s\t[%s]\t%s\n",
l.CreatedAt.Format(time.RFC3339),
l.CreatedAt.Format("2006-01-02 15:04:05.000"), // for consistency with slog
string(l.Level),
l.Output,
)
Expand All @@ -183,7 +183,7 @@ func humanizeBuildLogs(ls []codersdk.ProvisionerJobLog) string {
tw := tabwriter.NewWriter(&buf, 0, 2, 1, ' ', 0)
for _, l := range ls {
_, _ = fmt.Fprintf(tw, "%s\t[%s]\t%s\t%s\t%s\n",
l.CreatedAt.Format(time.RFC3339),
l.CreatedAt.Format("2006-01-02 15:04:05.000"), // for consistency with slog
string(l.Level),
string(l.Source),
l.Stage,
Expand Down