From e0002ef9ba79b7bb0b36046529e4eeb3b7dafec8 Mon Sep 17 00:00:00 2001 From: Joey Perrott Date: Wed, 20 May 2020 14:43:48 -0700 Subject: [PATCH] feat(dev-infra): migrate ng-dev utils to use new logging system (#37232) Migrate the ng-dev utils to use new logging system rather than directly calling console.* to create a better experience for users. PR Close #37232 --- dev-infra/utils/config.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dev-infra/utils/config.ts b/dev-infra/utils/config.ts index 67be487067..c586cf230b 100644 --- a/dev-infra/utils/config.ts +++ b/dev-infra/utils/config.ts @@ -10,6 +10,7 @@ import {existsSync} from 'fs'; import {dirname, join} from 'path'; import {exec} from 'shelljs'; +import {error} from './console'; import {isTsNodeAvailable} from './ts-node'; /** @@ -93,10 +94,10 @@ function readConfigFile(configPath: string): object { } try { - return require(configPath) + return require(configPath); } catch (e) { - console.error('Could not read configuration file.'); - console.error(e); + error('Could not read configuration file.'); + error(e); process.exit(1); } } @@ -109,9 +110,9 @@ export function assertNoErrors(errors: string[]) { if (errors.length == 0) { return; } - console.error(`Errors discovered while loading configuration file:`); - for (const error of errors) { - console.error(` - ${error}`); + error(`Errors discovered while loading configuration file:`); + for (const err of errors) { + error(` - ${err}`); } process.exit(1); }