How to use the pino-pretty function in pino-pretty

To help you get started, we’ve selected a few pino-pretty examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ArkEcosystem / core / packages / core-logger-pino / src / driver.ts View on Github external
private createPrettyTransport(level: string, prettyOptions?: PrettyOptions): Transform {
        const pinoPretty = PinoPretty({
            ...{
                levelFirst: false,
                translateTime: "yyyy-mm-dd HH:MM:ss.l",
            },
            ...prettyOptions,
        });

        const levelValue = this.logger.levels.values[level];

        return new Transform({
            transform(chunk, enc, cb) {
                try {
                    const json = JSON.parse(chunk);
                    if (json.level >= levelValue) {
                        const line = pinoPretty(json);
                        if (line !== undefined) {

pino-pretty

Prettifier for Pino log lines

MIT
Latest version published 2 months ago

Package Health Score

89 / 100
Full package analysis

Popular pino-pretty functions