MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / formatMessage

Method formatMessage

packages/cli-v3/src/utilities/logger.ts:88–104  ·  view source on GitHub ↗
(level: Exclude<LoggerLevel, "none">, message: string)

Source from the content-addressed store, hash-verified

86 }
87
88 private formatMessage(level: Exclude<LoggerLevel, "none">, message: string): string {
89 const kind = LOGGER_LEVEL_FORMAT_TYPE_MAP[level];
90 if (kind) {
91 // Format the message using the esbuild formatter.
92 // The first line of the message is the main `text`,
93 // subsequent lines are put into the `notes`.
94 const [firstLine, ...otherLines] = message.split("\n");
95 const notes = otherLines.length > 0 ? otherLines.map((text) => ({ text })) : undefined;
96 return formatMessagesSync([{ text: firstLine, notes }], {
97 color: true,
98 kind,
99 terminalWidth: this.columns,
100 })[0]!;
101 } else {
102 return message;
103 }
104 }
105}
106
107/**

Callers 1

doLogMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected