pino-logger 1.0.0
Install from the command line:
Learn more about npm packages
$ npm install @stegripe/pino-logger@1.0.0
Install via package.json:
"@stegripe/pino-logger": "1.0.0"
About this version
This plugin is used to create custom loggers with Pino.
- Easy to use
@stegripe/pino-logger
depends on the following packages. Be sure to install these along with this package!
You can use the following command to install this package, or replace pnpm install
with your package manager of choice.
pnpm install @stegripe/pino-logger
import { SapphireClient, SapphireClientOptions } from "@sapphire/framework";
import { PinoLogger } from "@stegripe/pino-logger";
export class MyClient extends SapphireClient {
public constructor(clientOptions: SapphireClientOptions) {
super({
...clientOptions,
logger: {
instance: new PinoLogger({
name: "MyClient",
timestamp: true,
level: ISDEV ? "debug" : "info",
formatters: {
bindings: () => ({ pid: `MyClient@${process.pid}` })
}
})
}
});
}
}
import { SapphireClient, SapphireClientOptions } from "@sapphire/framework";
import { PinoLogger } from "@stegripe/pino-logger";
export class MyClient extends SapphireClient {
public constructor(clientOptions: SapphireClientOptions) {
super({
...clientOptions,
logger: {
instance: new PinoLogger({
name: "MyClient",
timestamp: true,
level: ISDEV ? "debug" : "info",
formatters: {
bindings: () => ({ pid: `MyClient@${process.pid}` })
},
transport: {
targets: [{
target: "pino-pretty",
level: ISDEV ? "debug" : "info",
options: { translateTime: "SYS:yyyy-mm-dd HH:MM:ss" }
}]
}
})
}
});
}
}
Details
- pino-logger
-
stegripe
- 7 months ago
- AGPL-3.0
- 9 dependencies
Assets
- pino-logger-1.0.0.tgz
Download activity
- Total downloads 0
- Last 30 days 0
- Last week 0
- Today 0