pinojs/pino-debug được TopGit xếp vào nhóm dự án mã nguồn mở, với 166 sao trên GitHub, viết chủ yếu bằng JavaScript. 🌲high performance debug logging 🐞
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Seamlessly integrates the debug module with the high performance pino
logger so you can turn on debug logs in production scenarios
with minimum overhead.
Up to 10x faster than using debug (20x in extreme mode!)
JSON output with more detail (pino/bunyan/bole format)
Safe with circular references (debug isn't)
No need to replace any debug logging calls
Associate namespaces with log levels
Compatible with the entire pino ecosystem
Installation
$ npm install --save pino-debug
Usage
Preload
If all you want is fast JSON logging to STDOUT
$ DEBUG=* node -r pino-debug app.js
Namespaces are enabled the usual way, via the DEBUG
environment variable.
The namespace is also included in the log output, in the ns key.
Here's a sample log when the above is applied to a generic express app:
For fine grained control over output stream, and mappings
between debug namespaces and pino logger levels,
supply a pino instance and an optional options object with
a map property containing mappings.
NOTE: pino-debugmust be required at the entry point of your node process,
before any other modules have been loaded
The auto option turns on any namespaces listed in the map object
(so we don't have to use the DEBUG environment variable to turn them on).
API
NOTE: pino-debug can only be called once.
pinoDebug(pinoInstance) => undefined
Call pino-debug with a pino logger instance only and any debug namespaces
enabled via DEBUG or debug.enable will be logged with the level 20 ('debug').
Remember, if you want to see the messages you need to set the pino logger instance
logging level to 'debug'.
pinoDebug() => undefined
Call pino-debug without arguments and a default pino instance will be created with
the logging level set to 20 ('debug' level).
Any debug namespaces enabled via DEBUG or debug.enable will be logged
with the level 20 ('debug').
pinoDebug(pinoInstance, opts) => undefined
This is the recommended usage. Call pino-debug with a pino logger instance,
and an opts object containining map property.
opts.map{'debug-namespace: 'pino-loglevel-label'}
The keys of the map property correspond to the same namespaces that can be
set on the DEBUG environment variable:
If true (default) any debug namespaces found in the keys of opts.map will be
enabled.
Additionally, any debug namespaces enabled via DEBUG or debug.enable
will be logged with the level 20 ('debug').
If false, any namespaces that appear in opts.mapand are enabled via
DEBUG or debug.enable will be logged to with the corresponding log level,
(as specified in the opts.map). Any not specified in opts.map, but which
are enabled via DEBUG or debug.enable will be logged with the level 20 ('debug').
opts.skipArray
Equivalent of prefixing a namespace with dash (-) when specifying
DEBUG namespaces. Any namespaces specified will not be logged.
The start-preload script demonstrates preload usage. It set's
the DEBUG environment variable to log everything,
and then uses the -r flag to load pino-debug (relatively referenced).
The three scripts beginning start-programmatic all use a different
entry point where pino-debug has been required and instantiated with
a pino instance and the mappings (as shown in usage examples).
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/pinojs/pino-debug là nguồn chính thức.
pinojs/pino-debug có phải mã nguồn mở không?
Có — pinojs/pino-debug phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/pinojs/pino-debug.
pinojs/pino-debug là gì?
pinojs/pino-debug (pinojs/pino-debug) là dự án JavaScript trên GitHub. Theo mô tả gốc: 🌲high performance debug logging 🐞
Đọc đầy đủ README ở tab phía trên.
Chưa chắc pino-debug có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về pino-debug.