Use internal logger instead of debug/console for logging
Resolve #4104 Resolve #1966 Resolve #1937
This commit is contained in:
parent
3a5867b324
commit
0868c3517f
41 changed files with 136 additions and 109 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue