pinojs / pino-pretty

🌲Basic prettifier for Pino log lines
MIT License
1.27k stars 150 forks source link

additional parameters print? #388

Closed shlomich closed 1 year ago

shlomich commented 1 year ago

Hiya, it seems like pino-pretty is not printing additional parameters, I'm not sure whether this is a pino-pretty thing or pino. but here's the code I am using.

import { pino } from 'pino';
import pretty from 'pino-pretty';

const prettyOptions = {
  translateTime: 'yyyy-mm-dd HH:MM:ss',
  // colorize: true,
  sync: true,
  ignore: 'pid,hostname',
};

const stream = pretty(prettyOptions);
export const logger = pino(stream);
logger.level = 'debug';

now when I try to do the following:

const a = "aaa"
logger.info("printing a", a)

// Output: "INFO: printing a"

it doesn't append the parameter itself, any idea what I can do to solve it?

jsumners commented 1 year ago

https://getpino.io/#/docs/api?id=logger