From d77c15dac04e50fa22f2909258092f35058ec62d Mon Sep 17 00:00:00 2001 From: William Oldham Date: Tue, 7 Jan 2025 14:26:42 +0000 Subject: [PATCH] refactor: Use LOG_ERROR for error logging for timestamps --- src/services/npdl.ts | 3 ++- src/util.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/services/npdl.ts b/src/services/npdl.ts index 22906dc..a5b5b8e 100644 --- a/src/services/npdl.ts +++ b/src/services/npdl.ts @@ -3,6 +3,7 @@ import subdomain from 'express-subdomain'; import { getTaskFile } from '@/database'; import { getCDNFileStream } from '@/util'; import { Stream } from 'node:stream'; +import { LOG_ERROR } from '@/logger'; const npdl = express.Router(); @@ -41,7 +42,7 @@ npdl.get([ Stream.pipeline(readStream, response, (err) => { if (err) { - console.error('Error with response stream: ', err.message); + LOG_ERROR('Error with response stream: ' + err.message); response.end(); } }); diff --git a/src/util.ts b/src/util.ts index b8fbbd5..d258518 100644 --- a/src/util.ts +++ b/src/util.ts @@ -12,6 +12,7 @@ import { GetUserFriendPIDsResponse } from '@pretendonetwork/grpc/friends/get_use import { config, disabledFeatures } from '@/config-manager'; import { NodeJsClient } from '@smithy/types'; import { Response } from 'express'; +import { LOG_ERROR } from '@/logger'; let s3: NodeJsClient; @@ -68,7 +69,7 @@ export function fileErrCallback(response: Response) { if (!response.headersSent) { response.status(500).send('Server Error'); } - console.error('Error in sending file: ', err); + LOG_ERROR('Error in sending file: ' + err.message); } } };