Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't process all log arguments #133

Open
kana-dowjones opened this issue Mar 19, 2024 · 1 comment
Open

Doesn't process all log arguments #133

kana-dowjones opened this issue Mar 19, 2024 · 1 comment

Comments

@kana-dowjones
Copy link

In case of multiple log arguments

debug("Redis options", options);

native debug.js produces

package:server Redis options {
  host: 'redis.dev.aaa.io',
  port: '6379',
  password: 'some,
  no_ready_check: true,
  tls: { checkServerIdentity: [Function: checkServerIdentity] }
}

So it appends all arguments

But in pino-debug it doesn't happen

What happens is just

{"level":"debug","time":1710872452769,"ns":"oauth2-authorizer:server","msg":"Redis options"}

Possible solution

function enabled () {
    //return log.apply(logger, arguments) - this is what is currently in pino-debug
   
    let message = util.format.apply(util, arguments) // this is how debug.js formats argeuments
    return log.apply(logger, [message])
  }
@mcollina
Copy link
Member

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants