Skip to content

Commit 6e0b60d

Browse files
alan-agius4Keen Yee Liau
authored and
Keen Yee Liau
committed
fix(@angular/cli): errors and warnings are hard to read in windows cmd (#12767)
* fix(@angular-devkit/core): errors and warnings are hard to read in windows cmd Closes #12755 * fix(@angular/cli): errors and warnings are hard to read in windows cmd Closes #12755
1 parent 2bb26f1 commit 6e0b60d

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

packages/angular/cli/lib/cli/index.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,17 @@ function initializeLogging(logger: logging.Logger) {
8181
color = terminal.white;
8282
break;
8383
case 'warn':
84-
color = terminal.yellow;
85-
output = process.stderr;
86-
break;
87-
case 'error':
88-
color = terminal.red;
84+
color = (x: string) => terminal.bold(terminal.yellow(x));
8985
output = process.stderr;
9086
break;
9187
case 'fatal':
92-
color = (x) => terminal.bold(terminal.red(x));
88+
case 'error':
89+
color = (x: string) => terminal.bold(terminal.red(x));
9390
output = process.stderr;
9491
break;
9592
}
9693

94+
9795
// If we do console.log(message) or process.stdout.write(message + '\n'), the process might
9896
// stop before the whole message is written and the stream is flushed. This happens when
9997
// streams are asynchronous.

packages/angular_devkit/core/node/cli-logger.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,10 @@ export function createConsoleLogger(
3232
color = terminal.white;
3333
break;
3434
case 'warn':
35-
color = terminal.yellow;
36-
break;
37-
case 'error':
38-
color = terminal.red;
39-
output = stderr;
35+
color = (x: string) => terminal.bold(terminal.yellow(x));
4036
break;
4137
case 'fatal':
38+
case 'error':
4239
color = (x: string) => terminal.bold(terminal.red(x));
4340
output = stderr;
4441
break;

0 commit comments

Comments
 (0)