diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-12-19 22:32:04 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-12-19 22:41:49 +0800 |
commit | 85be2fbf19ef937709f747b0c9169a2cf3e6697e (patch) | |
tree | d30f38a72403cb9736fbe9218ef1725f0e80b538 /packages/sol-compiler | |
parent | 69de1d05efcadc1a6e70e98a0e77f32e8976560e (diff) | |
download | dexon-sol-tools-85be2fbf19ef937709f747b0c9169a2cf3e6697e.tar dexon-sol-tools-85be2fbf19ef937709f747b0c9169a2cf3e6697e.tar.gz dexon-sol-tools-85be2fbf19ef937709f747b0c9169a2cf3e6697e.tar.bz2 dexon-sol-tools-85be2fbf19ef937709f747b0c9169a2cf3e6697e.tar.lz dexon-sol-tools-85be2fbf19ef937709f747b0c9169a2cf3e6697e.tar.xz dexon-sol-tools-85be2fbf19ef937709f747b0c9169a2cf3e6697e.tar.zst dexon-sol-tools-85be2fbf19ef937709f747b0c9169a2cf3e6697e.zip |
Move logWithTime to logUtils
Diffstat (limited to 'packages/sol-compiler')
-rw-r--r-- | packages/sol-compiler/src/compiler.ts | 10 | ||||
-rw-r--r-- | packages/sol-compiler/src/utils/utils.ts | 6 |
2 files changed, 5 insertions, 11 deletions
diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts index 519712e20..eca887ce9 100644 --- a/packages/sol-compiler/src/compiler.ts +++ b/packages/sol-compiler/src/compiler.ts @@ -134,18 +134,18 @@ export class Compiler { } public async watchAsync(): Promise<void> { console.clear(); // tslint:disable-line:no-console - utils.logWithTime('Starting compilation in watch mode...'); + logUtils.logWithTime('Starting compilation in watch mode...'); const watcher = chokidar.watch('^$', { ignored: /(^|[\/\\])\../ }); const onFileChangedAsync = async () => { watcher.unwatch('*'); // Stop watching try { await this.compileAsync(); - utils.logWithTime('Found 0 errors. Watching for file changes.'); + logUtils.logWithTime('Found 0 errors. Watching for file changes.'); } catch (err) { if (err.typeName === 'CompilationError') { - utils.logWithTime(`Found ${err.errorsCount} ${pluralize('error', err.errorsCount)}. Watching for file changes.`); + logUtils.logWithTime(`Found ${err.errorsCount} ${pluralize('error', err.errorsCount)}. Watching for file changes.`); } else { - utils.logWithTime('Found errors. Watching for file changes.'); + logUtils.logWithTime('Found errors. Watching for file changes.'); } } @@ -155,7 +155,7 @@ export class Compiler { await onFileChangedAsync(); watcher.on('change', (changedFilePath: string) => { console.clear(); // tslint:disable-line:no-console - utils.logWithTime('File change detected. Starting incremental compilation...'); + logUtils.logWithTime('File change detected. Starting incremental compilation...'); // NOTE: We can't await it here because that's a callback. // Instead we stop watching inside of it and start it again when we're finished. onFileChangedAsync(); // tslint:disable-line no-floating-promises diff --git a/packages/sol-compiler/src/utils/utils.ts b/packages/sol-compiler/src/utils/utils.ts index 538efc61a..4f2de2caa 100644 --- a/packages/sol-compiler/src/utils/utils.ts +++ b/packages/sol-compiler/src/utils/utils.ts @@ -1,12 +1,6 @@ -import { logUtils } from '@0x/utils'; -import chalk from 'chalk'; - export const utils = { stringifyWithFormatting(obj: any): string { const stringifiedObj = JSON.stringify(obj, null, '\t'); return stringifiedObj; }, - logWithTime(arg: string): void { - logUtils.log(`[${chalk.gray(new Date().toLocaleTimeString())}] ${arg}`); - }, }; |