Skip to content

Commit d1dbd41

Browse files
committed
better logs printing
1 parent 3d51324 commit d1dbd41

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

main.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,14 @@ const logsCommand = new Command<{ endpoint: string }>()
181181
seenIds.add(id);
182182
}
183183

184-
let text = `[${renderTemporalTimestamp(log.Timestamp)}${
184+
const prefix = `[${renderTemporalTimestamp(log.Timestamp)}${
185185
log.TraceId ? ` (${log.TraceId})` : ""
186-
}] ${log.Body}`;
186+
}]`;
187+
let text = `${prefix} ${log.Body}`;
187188
if (text.endsWith("\n")) {
188189
text = text.slice(0, -1);
189190
}
191+
text = text.replaceAll("\n", "\n".padEnd(prefix.length + 1));
190192

191193
if (log.SeverityNumber >= 17) {
192194
console.log(red(text));

0 commit comments

Comments
 (0)