From ab3f8fd10c9a0b579fb5ecca507601263cd9f943 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Thu, 16 Aug 2018 00:13:24 +0900 Subject: [PATCH] Enhance log message --- src/index.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/index.ts b/src/index.ts index 0dda8b05b7..c2994c606c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -48,7 +48,7 @@ main(); * Init process */ function main() { - process.title = `Misskey (${ cluster.isMaster ? 'master' : 'worker' })`; + process.title = `Misskey (${cluster.isMaster ? 'master' : 'worker'})`; if (cluster.isMaster || program.disableClustering) { masterMain(); @@ -154,11 +154,10 @@ async function init(): Promise { function checkMongoDb(config: Config) { const mongoDBLogger = new Logger('MongoDB'); - mongoDBLogger.info(`Host: ${config.mongodb.host}`); - mongoDBLogger.info(`Port: ${config.mongodb.port}`); - mongoDBLogger.info(`DB: ${config.mongodb.db}`); - if (config.mongodb.user) mongoDBLogger.info(`User: ${config.mongodb.user}`); - if (config.mongodb.pass) mongoDBLogger.info(`Pass: ****`); + const u = config.mongodb.user ? encodeURIComponent(config.mongodb.user) : null; + const p = config.mongodb.pass ? encodeURIComponent(config.mongodb.pass) : null; + const uri = `mongodb://${u && p ? `${u}:****@` : ''}${config.mongodb.host}:${config.mongodb.port}/${config.mongodb.db}`; + mongoDBLogger.info(`Connecting to ${uri}`); require('./db/mongodb'); mongoDBLogger.succ('Connectivity confirmed'); }