Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
pino-http-print
Advanced tools
Readme
Debug HTTP printer for pino
[1574071926285] GET http://localhost:20000/api/activity/component 200\n
You can use this module as a pino transport like so:
const pino = require('pino')
const transport = pino.transport({
target: 'pino-http-print',
level: 'info',
options: {
destination: 1, // optional (default stdout)
all: true,
colorize: false,
translateTime: true
... // other options
}
})
pino(transport)
The options object's properties are described below. There is only one extra property:
prettyOptions
: this property is forwarded to pino-pretty
for non-http logs (when all
is true). It must be pino-pretty
options object.const { httpPrintFactory } = require('pino-http-print')
const printer = httpPrintFactory()
var logger = require('pino-http')(printer)
const { httpPrintFactory } = require('pino-http-print')
const printer = httpPrintFactory()
const logger = require('express-pino-logger')(printer)
Same for koa-pino-logger
and restify-pino-logger
,
just pass in the printer
stream.
Returns a new printer.
The common options between this and pino-pretty
options are set from the first object itself. pinoPrettyOptions
is forwarded to pino-pretty
for non-http logs (when all
is true).
See the Options section for all possible options.
Returns a stream that will pull off
Options argument for httpPrintFactory
with keys corresponding to the options described in CLI Arguments:
{
colorize: colorette.isColorSupported, // --colorize
all: false, // --all
translateTime: false, // --translateTime
relativeUrl: false, // --relativeUrl
lax: false // --lax
}
The colorize
default follows
colorette.isColorSupported
.
Pino supports a legacy transport interface that is still supported by this module.
npm install -g pino-http-print
Spin up server that uses a pino http logger and pipe it to pino-http-print
node server | pino-http-print
-all
(-a
): Causes pino-http-print
to also print non-HTTP log messages by passing them through to pino-pretty
.--colorize
(-c
): Adds terminal color escape sequences to the output.--translateTime
(-t
): Translate the epoch time value into a human readable
date and time string. This flag also can set the format string to apply when
translating the date to human readable format. This is the same as pino-pretty
translateTime
yyyy-mm-dd HH:MM:ss.l o
in UTC.--relativeUrl
(-r
): print only the relative urlMIT
FAQs
Debug HTTP printer for pino
The npm package pino-http-print receives a total of 22,267 weekly downloads. As such, pino-http-print popularity was classified as popular.
We found that pino-http-print demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.