Socket
Socket
Sign inDemoInstall

@prisma/debug

Package Overview
Dependencies
0
Maintainers
6
Versions
7698
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @prisma/debug

This package is intended for Prisma's internal use


Version published
Weekly downloads
1.8M
increased by8.15%
Maintainers
6
Created
Weekly downloads
 

Package description

What is @prisma/debug?

The @prisma/debug package is designed to help developers debug applications that use Prisma by providing detailed logging capabilities. It allows developers to enable or disable logging for different parts of the Prisma framework, making it easier to trace and diagnose issues related to database queries and the ORM layer.

What are @prisma/debug's main functionalities?

Enable Debugging

This code snippet enables debugging for the Prisma client, which logs all the queries and internal operations performed by the Prisma client. This is useful for understanding the queries generated by Prisma and their performance implications.

process.env.DEBUG = 'prisma-client';

Selective Debugging

This snippet enables debugging selectively for both the Prisma client and the underlying Prisma engine. It helps in tracing issues that might be occurring not just at the ORM level but also at the database engine level that Prisma interacts with.

process.env.DEBUG = 'prisma-client,prisma-engine';

Other packages similar to @prisma/debug

Readme

Source

@prisma/debug

A cached debug.


⚠️ Warning: This package is intended for Prisma's internal use. Its release cycle does not follow SemVer, which means we might release breaking changes (change APIs, remove functionality) without any prior warning.

If you are using this package, it would be helpful if you could help us gain an understanding where, how and why you are using it. Your feedback will be valuable to us to define a better API. Please share this information at https://github.com/prisma/prisma/discussions/13877 - Thanks!

Usage

import Debug, { getLogs } from '@prisma/debug'

const debug = Debug('my-namespace')

try {
  debug('hello')
  debug(process.env)
  throw new Error('oops')
} catch (e) {
  console.error(e)
  console.error(`We just crashed. But no worries, here are the debug logs:`)
  // get 10 last lines of debug logs
  console.error(getLogs(10))
}

FAQs

Last updated on 23 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc