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

Function humanizeBuildLogs

cli/support.go:648–662  ·  view source on GitHub ↗
(ls []codersdk.ProvisionerJobLog)

Source from the content-addressed store, hash-verified

646}
647
648func humanizeBuildLogs(ls []codersdk.ProvisionerJobLog) string {
649 var buf bytes.Buffer
650 tw := tabwriter.NewWriter(&buf, 0, 2, 1, ' ', 0)
651 for _, l := range ls {
652 _, _ = fmt.Fprintf(tw, "%s\t[%s]\t%s\t%s\t%s\n",
653 l.CreatedAt.Format("2006-01-02 15:04:05.000"), // for consistency with slog
654 string(l.Level),
655 string(l.Source),
656 l.Stage,
657 l.Output,
658 )
659 }
660 _ = tw.Flush()
661 return buf.String()
662}
663
664func humanizeLicenses(licenses []codersdk.License) (string, error) {
665 formatter := cliutil.NewLicenseFormatter()

Callers 1

writeBundleFunction · 0.85

Calls 3

FormatMethod · 0.65
FlushMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected