mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2025-04-17 18:18:11 +00: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
1 changed files with 5 additions and 1 deletions
|
@ -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 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({
|
||||
log: ["query", "info", "warn"],
|
||||
log: logLevels,
|
||||
});
|
||||
|
||||
module.exports = prisma;
|
||||
|
|
Loading…
Add table
Reference in a new issue