From 238c6a428be14f484dac102289af183aec2a48fd Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 3 Feb 2019 04:18:27 +0900 Subject: [Server] Use logger for logging --- src/remote/activitypub/request.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/remote/activitypub/request.ts') diff --git a/src/remote/activitypub/request.ts b/src/remote/activitypub/request.ts index 366d7e19a4..519c8026bc 100644 --- a/src/remote/activitypub/request.ts +++ b/src/remote/activitypub/request.ts @@ -1,7 +1,6 @@ import { request } from 'https'; import { sign } from 'http-signature'; import { URL } from 'url'; -import * as debug from 'debug'; import * as crypto from 'crypto'; import { lookup, IRunOptions } from 'lookup-dns-cache'; import * as promiseAny from 'promise-any'; @@ -9,11 +8,12 @@ import * as promiseAny from 'promise-any'; import config from '../../config'; import { ILocalUser } from '../../models/user'; import { publishApLogStream } from '../../stream'; +import { apLogger } from './logger'; -const log = debug('misskey:activitypub:deliver'); +export const logger = apLogger.createSubLogger('deliver'); export default (user: ILocalUser, url: string, object: any) => new Promise(async (resolve, reject) => { - log(`--> ${url}`); + logger.info(`--> ${url}`); const timeout = 10 * 1000; @@ -43,7 +43,7 @@ export default (user: ILocalUser, url: string, object: any) => new Promise(async 'Digest': `SHA-256=${hash}` } }, res => { - log(`${url} --> ${res.statusCode}`); + logger.info(`${url} --> ${res.statusCode}`); if (res.statusCode >= 400) { reject(res); -- cgit v1.2.3-freya