From dc21a819d65c3c80215a1593d1cc238df6187b4e Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Thu, 29 Dec 2016 17:50:57 +0900 Subject: [PATCH] Use logger --- src/index.ts | 12 ++++++------ src/utils/check-dependencies.ts | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/index.ts b/src/index.ts index f22364a998..2efeb47e51 100644 --- a/src/index.ts +++ b/src/index.ts @@ -133,22 +133,22 @@ function worker(): void { * Init app */ async function init(): Promise { - console.log('Welcome to Misskey!\n'); + log('Info', 'Welcome to Misskey!'); - console.log(chalk.bold('Misskey Core ')); + log('Info', chalk.bold('Misskey Core ')); let warn = false; // Get commit info try { const commit = await prominence(git).getLastCommit(); - console.log(`commit: ${commit.shortHash} ${commit.author.name} <${commit.author.email}>`); - console.log(` ${new Date(parseInt(commit.committedOn, 10) * 1000)}`); + log('Info', `commit: ${commit.shortHash} ${commit.author.name} <${commit.author.email}>`); + log('Info', ` ${new Date(parseInt(commit.committedOn, 10) * 1000)}`); } catch (e) { // noop } - console.log('\nInitializing...\n'); + log('Info', 'Initializing...'); if (IS_DEBUG) { log('Warn', 'It is not in the Production mode. Do not use in the Production environment.'); @@ -219,5 +219,5 @@ function spawn(callback: any): void { // Dying away... process.on('exit', () => { - console.log('Bye.'); + log('Info', 'Bye.'); }); diff --git a/src/utils/check-dependencies.ts b/src/utils/check-dependencies.ts index 94b3bd3518..6265e9aad7 100644 --- a/src/utils/check-dependencies.ts +++ b/src/utils/check-dependencies.ts @@ -6,7 +6,6 @@ export default function(): void { checkDependency('npm', 'npm -v', x => x.match(/^(.*)\r?\n$/)[1]); checkDependency('MongoDB', 'mongo --version', x => x.match(/^MongoDB shell version: (.*)\r?\n$/)[1]); checkDependency('Redis', 'redis-server --version', x => x.match(/v=([0-9\.]*)/)[1]); - log('Info', 'Successfully checked external dependencies'); } function checkDependency(serviceName: string, command: string, transform: (x: string) => string): void {