Use internal logger instead of debug/console for logging

Resolve #4104
Resolve #1966
Resolve #1937
This commit is contained in:
syuilo 2019-02-03 18:16:57 +09:00
parent 3a5867b324
commit 0868c3517f
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
41 changed files with 136 additions and 109 deletions

View file

@ -1,6 +1,6 @@
import * as mongo from 'mongodb';
import * as deepcopy from 'deepcopy';
import db from '../db/mongodb';
import db, { dbLogger } from '../db/mongodb';
import isObjectId from '../misc/is-objectid';
import { IUser, pack as packUser } from './user';
import { pack as packNote } from './note';
@ -106,12 +106,12 @@ export const pack = (notification: any) => new Promise<any>(async (resolve, reje
// (データベースの不具合などで)投稿が見つからなかったら
if (_notification.note == null) {
console.warn(`[DAMAGED DB] (missing) pkg: notification -> note :: ${_notification.id} (note ${_notification.noteId})`);
dbLogger.warn(`[DAMAGED DB] (missing) pkg: notification -> note :: ${_notification.id} (note ${_notification.noteId})`);
return resolve(null);
}
break;
default:
console.error(`Unknown type: ${_notification.type}`);
dbLogger.error(`Unknown type: ${_notification.type}`);
break;
}