Skip to content

Commit aec0bcb

Browse files
committed
Omit ANSI formatting in logger files
1 parent 66f3029 commit aec0bcb

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

.changeset/early-knives-sing.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@gud/cli-menu": patch
3+
---
4+
5+
Patched logger plugin to remove ANSI bold formatting syntax when logging to a file.

packages/cli/src/plugins/logger.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,12 @@ export function logger({
169169

170170
// Create a function to centralize the logging logic.
171171
function log(client: Client, message: string, ...data: any[]) {
172-
const formattedMessage = `${getPrefix()}${bold(message)}`;
172+
let formattedMessage = getPrefix();
173173
if (logFile) {
174+
formattedMessage += message;
174175
logToFile(logFile, formattedMessage, ...data);
175176
} else {
177+
formattedMessage += bold(message);
176178
client.log(`${formattedMessage}:`, ...data.map((d) => formatData(d)));
177179
}
178180
}

0 commit comments

Comments
 (0)