feat: adds configurable logging (#4914)

Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
Co-authored-by: pandeymangg <anshuman.pandey9999@gmail.com>
This commit is contained in:
Piyush Gupta
2025-03-21 18:39:13 +05:30
committed by GitHub
parent 7dd5cf8b6e
commit 5527f184b7
150 changed files with 1167 additions and 292 deletions
@@ -5,6 +5,7 @@ import { prisma } from "@formbricks/database";
import { cache } from "@formbricks/lib/cache";
import { projectCache } from "@formbricks/lib/project/cache";
import { validateInputs } from "@formbricks/lib/utils/validate";
import { logger } from "@formbricks/logger";
import { DatabaseError } from "@formbricks/types/errors";
export const getProjectByEnvironmentId = reactCache(
@@ -29,7 +30,7 @@ export const getProjectByEnvironmentId = reactCache(
return projectPrisma;
} catch (error) {
if (error instanceof Prisma.PrismaClientKnownRequestError) {
console.error(error);
logger.error(error, "Error fetching project by environment id");
throw new DatabaseError(error.message);
}
throw error;