Skip to content

Commit 5b4a80b

Browse files
committed
fix: Logging should be off by default
Set `PRISMA_FIELD_ENCRYPTION_LOG` to `true` to enable it.
1 parent 6ad35c4 commit 5b4a80b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ export function fieldEncryptionMiddleware(
2222
const encryptionConfig = configureEncryption(params, fields)
2323

2424
const logger =
25-
process.env.PRISMA_FIELD_ENCRYPTION_LOG === 'false'
26-
? {
25+
process.env.PRISMA_FIELD_ENCRYPTION_LOG === 'true'
26+
? console
27+
: {
2728
log: (_args: any) => {},
2829
info: (_args: any) => {},
2930
dir: (_args: any) => {},
3031
error: console.error, // Still log errors
3132
warn: console.warn // and warnings
3233
}
33-
: console
3434

3535
const operation = `${params.model}.${params.action}`
3636

0 commit comments

Comments
 (0)