MCPcopy Index your code
hub / github.com/coder/coder / humanizeAgentLogs

Function humanizeAgentLogs

cli/support.go:634–646  ·  view source on GitHub ↗
(ls []codersdk.WorkspaceAgentLog)

Source from the content-addressed store, hash-verified

632}
633
634func humanizeAgentLogs(ls []codersdk.WorkspaceAgentLog) string {
635 var buf bytes.Buffer
636 tw := tabwriter.NewWriter(&buf, 0, 2, 1, ' ', 0)
637 for _, l := range ls {
638 _, _ = fmt.Fprintf(tw, "%s\t[%s]\t%s\n",
639 l.CreatedAt.Format("2006-01-02 15:04:05.000"), // for consistency with slog
640 string(l.Level),
641 l.Output,
642 )
643 }
644 _ = tw.Flush()
645 return buf.String()
646}
647
648func humanizeBuildLogs(ls []codersdk.ProvisionerJobLog) string {
649 var buf bytes.Buffer

Callers 1

writeBundleFunction · 0.85

Calls 3

FormatMethod · 0.65
FlushMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected