Skip to content

Commit dcb7689

Browse files
simplify log parameter names for newline
1 parent 183fc20 commit dcb7689

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/cli/logger.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ const log = (msg: string, color: Color | null, newLine: boolean) =>
2222
logFns[newLine ? 'writeLn' : 'write'](color ? colors[color](msg) : msg);
2323

2424
export interface Logger {
25-
err: (msg: string, noNewLine?: boolean) => void;
26-
log: (msg: string, noNewLine?: boolean) => void;
27-
ok: (msg: string, noNewLine?: boolean) => void;
28-
warn: (msg: string, noNewLine?: boolean) => void;
25+
err: (msg: string, newLine?: boolean) => void;
26+
log: (msg: string, newLine?: boolean) => void;
27+
ok: (msg: string, newLine?: boolean) => void;
28+
warn: (msg: string, newLine?: boolean) => void;
2929
}
3030

3131
const logger: Logger = {
32-
err: (msg: string, noNewLine?: boolean) => log(msg, 'red', !noNewLine),
33-
log: (msg: string, noNewLine?: boolean) => log(msg, null, !noNewLine),
34-
ok: (msg: string, noNewLine?: boolean) => log(msg, 'green', !noNewLine),
35-
warn: (msg: string, noNewLine?: boolean) => log(msg, 'yellow', !noNewLine)
32+
err: (msg: string, newLine = true) => log(msg, 'red', newLine),
33+
log: (msg: string, newLine = true) => log(msg, null, newLine),
34+
ok: (msg: string, newLine = true) => log(msg, 'green', newLine),
35+
warn: (msg: string, newLine = true) => log(msg, 'yellow', newLine)
3636
};
3737

3838
export default logger;

0 commit comments

Comments
 (0)