Skip to content

Commit 4bbd1bf

Browse files
oBuskclydin
authored andcommitted
fix(@angular/cli): restore console methods after logger completes
1 parent 8ab9375 commit 4bbd1bf

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
@@ -40,6 +40,7 @@ export default async function (options: { cliArgs: string[] }) {
4040
};
4141
const logger = new logging.IndentLogger('cli-main-logger');
4242
const logInfo = console.log;
43+
const logWarn = console.warn;
4344
const logError = console.error;
4445
const useColor = supportColor();
4546

@@ -109,5 +110,11 @@ export default async function (options: { cliArgs: string[] }) {
109110
} finally {
110111
logger.complete();
111112
await loggerFinished;
113+
114+
// Restore original console methods so that late consumers
115+
// (e.g. process.on('exit') handlers) still produce output.
116+
console.log = console.info = logInfo;
117+
console.warn = logWarn;
118+
console.error = logError;
112119
}
113120
}

0 commit comments

Comments
 (0)