refactor: Use LOG_ERROR for error logging for timestamps

This commit is contained in:
William Oldham 2025-01-07 14:26:42 +00:00
parent c3c1dd297e
commit d77c15dac0
2 changed files with 4 additions and 2 deletions

View File

@ -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();
}
});

View File

@ -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<S3Client>;
@ -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);
}
}
};