Skip to content

Commit 9cdcd01

Browse files
authored
Chore/debug-prisma-query (#36)
1 parent be0d5b3 commit 9cdcd01

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/lib/prisma.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PrismaClient } from "@prisma/client";
1+
import { PrismaClient } from '@prisma/client';
22
const globalForPrisma = global as unknown as { prisma: PrismaClient };
33
const prisma =
44
globalForPrisma.prisma ||
@@ -9,15 +9,15 @@ const prisma =
99
},
1010
},
1111
log: [
12-
"warn",
13-
"error",
12+
'warn',
13+
'error',
1414
{
15-
level: "query",
16-
emit: "event",
15+
level: 'query',
16+
emit: process.env.NODE_ENV === 'production' ? 'event' : 'stdout',
1717
},
1818
],
1919
});
2020

21-
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
21+
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma;
2222

2323
export default prisma;

0 commit comments

Comments
 (0)