PingZing
PPrisma
•Created by PingZing on 12/17/2024 in #help-and-questions
Declaring a PrismaClient with conditional logging
Hi folks! I'm trying to instantiate a PrismaClient in a TypeScript project. I'm using v6.0.1, and have the following code:
Unfortunately, on the line where I set up the error logging, I get the following error:
Argument of type '"error"' is not assignable to parameter of type 'never'.
I can fix that if I declare my array of LogDefinition
s inline with the PrismaClient
but I'd like to conditionally set up my log levels, which means I can't do everything inline. Is there a way around this?7 replies