Update logger

This commit is contained in:
Aya Morisawa 2016-12-29 23:09:21 +09:00
parent dcc32d5581
commit 5b0a227382
3 changed files with 68 additions and 35 deletions

View file

@ -1,4 +1,4 @@
import { log } from './logger';
import Logger from './logger';
import { exec } from 'shelljs';
export default function(): void {
@ -14,9 +14,10 @@ function checkDependency(serviceName: string, command: string, transform: (x: st
notFound: 127
};
const x = exec(command, { silent: true }) as any;
let depsLogger = new Logger('Deps');
if (x.code === code.success) {
log('Info', `${serviceName} ${transform(x.stdout)} found`, 'Deps');
depsLogger.info(`${serviceName} ${transform(x.stdout)} found`);
} else if (x.code === code.notFound) {
log('Warn', `${serviceName} not found`, 'Deps');
depsLogger.warn(`${serviceName} not found`);
}
}