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

Method Text

codersdk/workspaceagents.go:232–249  ·  view source on GitHub ↗

Text formats the log entry as human-readable text.

(agentName, sourceName string)

Source from the content-addressed store, hash-verified

230
231// Text formats the log entry as human-readable text.
232func (l WorkspaceAgentLog) Text(agentName, sourceName string) string {
233 var sb strings.Builder
234 _, _ = sb.WriteString(l.CreatedAt.Format(time.RFC3339))
235 _, _ = sb.WriteString(" [")
236 _, _ = sb.WriteString(string(l.Level))
237 _, _ = sb.WriteString("] [agent")
238 if agentName != "" {
239 _, _ = sb.WriteString(".")
240 _, _ = sb.WriteString(agentName)
241 }
242 if sourceName != "" {
243 _, _ = sb.WriteString("|")
244 _, _ = sb.WriteString(sourceName)
245 }
246 _, _ = sb.WriteString("] ")
247 _, _ = sb.WriteString(l.Output)
248 return sb.String()
249}
250
251type AgentSubsystem string
252

Calls 3

WriteStringMethod · 0.80
FormatMethod · 0.65
StringMethod · 0.45