Skip to content

Commit a7787d0

Browse files
oBuskclydin
authored andcommitted
fix(@angular/cli): restore console methods after logger completes
(cherry picked from commit 4bbd1bf)
1 parent 628c586 commit a7787d0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export default async function (options: { cliArgs: string[] }) {
4444
};
4545
const logger = new logging.IndentLogger('cli-main-logger');
4646
const logInfo = console.log;
47+
const logWarn = console.warn;
4748
const logError = console.error;
4849
const useColor = supportColor();
4950

@@ -113,5 +114,11 @@ export default async function (options: { cliArgs: string[] }) {
113114
} finally {
114115
logger.complete();
115116
await loggerFinished;
117+
118+
// Restore original console methods so that late consumers
119+
// (e.g. process.on('exit') handlers) still produce output.
120+
console.log = console.info = logInfo;
121+
console.warn = logWarn;
122+
console.error = logError;
116123
}
117124
}

0 commit comments

Comments
 (0)