feat: add logging enhancements by integrating pino and pino-pretty for improved error tracking and debugging across the application

This commit is contained in:
Julien Froidefond
2025-10-26 06:15:47 +01:00
parent 7cc72dc13d
commit 52350a43d9
84 changed files with 455 additions and 177 deletions

View File

@@ -1,6 +1,7 @@
import { BaseApiService } from "./base-api.service";
import { ERROR_CODES } from "../../constants/errorCodes";
import { AppError } from "../../utils/errors";
import logger from "@/lib/logger";
export interface ImageResponse {
buffer: Buffer;
@@ -23,7 +24,7 @@ export class ImageService extends BaseApiService {
contentType,
};
} catch (error) {
console.error("Erreur lors de la récupération de l'image:", error);
logger.error({ err: error }, "Erreur lors de la récupération de l'image");
throw new AppError(ERROR_CODES.IMAGE.FETCH_ERROR, {}, error);
}
}