debug
pino
debug | pino | |
---|---|---|
27 | 38 | |
11,003 | 13,297 | |
0.3% | 1.3% | |
3.6 | 8.6 | |
8 months ago | 4 days ago | |
JavaScript | JavaScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
debug
-
Why write a library?
Number of dependencies: one way to tell if a library is not too challenging to be used as study source is based on the production dependencies count. The fewer the better. For example, I chose debug because it only has 1 dependency (ms), while the rest of the code relies on core NodeJS modules - which is exactly what I was looking for - to learn how to build a library from scratch, not off the shelf libraries with many external deps, which in turn are based on more deps. There you go, dependency hell.
-
Conditional logging
Another way to solve this is to have the logs in place, but only enable them conditionally. If you enable all the logs are the time, you only get a lot of noise that won't help you. If you are using JavaScript, you can use the package debug to add logs that are active by the DEBUG environment variable.
-
Has anyone figured out how to enable the millisecond diff feature in the debug package?
I'm using the debug package: https://www.npmjs.com/package/debug, but some reason I don't see millisecond diffs, which would be really useful.
- Help I have a JavaScript Lib that blows away competition but nobody knows of it
-
What is the DEBUG ๐ environment variable in Node.js, and how to use it?
Although it's used by Express, it's indeed more broadly, the way a popular NPM package called debug works, which is used internally in Express too. Under the hood, the debug package expects the DEBUG environment variable to determine what debug messages to print (could be on the console, or into a file, or into stdout to be collected by a log aggregator service).
-
Automating console logs for dev but removing for prod?
Finally, if they're logs you want to be able to inspect in production without printing them to the console by default, you can use debug.
-
After having used many loggers/debuggers...
It is a drop-in, TypeScript replacement to enhance the widely popular https://www.npmjs.com/package/debug (230k weekly downloads).
-
Create a Node.js command-line library with NRWL NX workspace
debug - npm - Required. A popular library to write debug logs.
-
Debugging Figma and other packaged Electron apps in Visual Studio Code
I strongly recommend using the debug package from NPM to organize your log messages
-
Is it bad practice to log within a shared library?
Use the [debug npm library](https://www.npmjs.com/package/debug) to disable your logging unless someone provides the right environment variable (e.g. DEBUG=* which enables all logging)
pino
-
Migrate Your Express Application to Fastify
Learn more about logging in Fastify and how to customize the Pino logger.
-
Logs monitoring with Loki, Node.js and Fastify.js
The Fastify framework includes the Pino logger by default (a really great logger with lots of cool features that doesn't compromise on performance). The framework itself allows a lot of really cool stuff, like controlling the level of logs at runtime.
- Advice on Node Logging to Google Cloud Platform
-
Getting Started with Fastify for Node.js
Fastify provides a built-in logging mechanism based on Pino that allows you to capture various events in your applications. Once enabled, Fastify logs all incoming requests to the server and errors that occur while processing said requests. It also provides a convenient way to log custom messages through the log() method on the Fastify instance or the request object.
-
10 Powerful Node.js Libraries Every Developer Should Know About
1. pino
-
Node.js 20 Released: Experimental Perms, new V8, and Single Executable Apps
Vitest is for frontend. Jest is not good for backend (I donโt like it for frontend either), take a look at this issue.
-
What is the preferred stack for managing medium to large-size logs?
Have a look at https://github.com/pinojs/pino
-
Logging in your API
NodeJS -> Pino, Winston, Bunyan, Npmlog, e.t.c.
-
Logging practices
Use a configurable logger like pino
-
Logging - correlationId - headers - how?
Using pino as a logger, for every request on the _server_ , a unique ID generated client side in the headers, so a log may be something like:
What are some alternatives?
node-inspector - Node.js debugger based on Blink Developer Tools
winston - A logger for just about everything.
npm-fast-installer - npm-fast-installer - NPM install configuration in top of YAML for fast NPM install usage.
Bunyan - a simple and fast JSON logging module for node.js services
bugger - Bugs bugging you? Bug back.
console-log-level - The most simple logger imaginable
ndb - ndb is an improved debugging experience for Node.js, enabled by Chrome DevTools
log4js-node - A port of log4js to node.js
longjohn - Long stack traces for node.js inspired by https://github.com/tlrobinson/long-stack-traces
winston-daily-rotate-file - A transport for winston which logs to a rotating file each day.
swagger-stats - API Observability. Trace API calls and Monitor API performance, health and usage statistics in Node.js Microservices.
opentelemetry-specification - Specifications for OpenTelemetry