feat(dev-infra): migrate format tool to use new logging system (#37232)
Migrate the formatting tool in ng-dev to use new logging system rather than directly calling console.* to create a better experience for users. PR Close #37232
This commit is contained in:

committed by
Matias Niemelä

parent
52c7aae4df
commit
40e357411e
@ -11,6 +11,8 @@ import * as multimatch from 'multimatch';
|
||||
import {cpus} from 'os';
|
||||
import {exec} from 'shelljs';
|
||||
|
||||
import {info} from '../utils/console';
|
||||
|
||||
import {Formatter, FormatterAction, getActiveFormatters} from './formatters';
|
||||
|
||||
const AVAILABLE_THREADS = Math.max(cpus().length - 1, 1);
|
||||
@ -47,10 +49,10 @@ export function runFormatterInParallel(allFiles: string[], action: FormatterActi
|
||||
|
||||
switch (action) {
|
||||
case 'format':
|
||||
console.info(`Formatting ${pendingCommands.length} file(s)`);
|
||||
info(`Formatting ${pendingCommands.length} file(s)`);
|
||||
break;
|
||||
case 'check':
|
||||
console.info(`Checking format of ${pendingCommands.length} file(s)`);
|
||||
info(`Checking format of ${pendingCommands.length} file(s)`);
|
||||
break;
|
||||
default:
|
||||
throw Error(`Invalid format action "${action}": allowed actions are "format" and "check"`);
|
||||
|
Reference in New Issue
Block a user