mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-19 20:50:09 +01:00
Disable prisma logs on prod (#371)
* disable prisma logs on prod * linting * keep const top level --------- Co-authored-by: timothycarambat <rambat1010@gmail.com>
This commit is contained in:
parent
a96a9d41a3
commit
1aa58dcb7b
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user