Skip to content
Snippets Groups Projects
Unverified Commit 1aa58dcb authored by Sean Hatfield's avatar Sean Hatfield Committed by GitHub
Browse files

Disable prisma logs on prod (#371)


* disable prisma logs on prod

* linting

* keep const top level

---------

Co-authored-by: default avatartimothycarambat <rambat1010@gmail.com>
parent a96a9d41
No related branches found
No related tags found
No related merge requests found
...@@ -5,8 +5,12 @@ const { PrismaClient } = require("@prisma/client"); ...@@ -5,8 +5,12 @@ const { PrismaClient } = require("@prisma/client");
// npx prisma migrate dev --name init -> ensures that db is in sync with schema // npx prisma migrate dev --name init -> ensures that db is in sync with schema
// npx prisma migrate reset -> resets the db // npx prisma migrate reset -> resets the db
const isProd = process.env.NODE_ENV === "production";
const logLevels = isProd
? ["error", "info", "warn"]
: ["query", "info", "warn", "error"];
const prisma = new PrismaClient({ const prisma = new PrismaClient({
log: ["query", "info", "warn"], log: logLevels,
}); });
module.exports = prisma; module.exports = prisma;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment