Skip to content

Support Multi-Parameters #230

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

Closed
luqin opened this issue Oct 14, 2015 · 3 comments
Closed

Support Multi-Parameters #230

luqin opened this issue Oct 14, 2015 · 3 comments

Comments

@luqin
Copy link

luqin commented Oct 14, 2015

like this:

import debug from 'debug/browser';

let error = debug('app:error');
error.log = console.error.bind(console);

error('1', 2, [1, 2]);
@TooTallNate
Copy link
Contributor

That should already work fine. What are you experiencing?

@emilhem
Copy link

emilhem commented Feb 4, 2016

It seems like it works but it's producing the following output:

  app:error 1 +5ms 2 [ 1, 2 ]

The +5ms I think should be at the end.

I'm using version 2.2.0

@agirorn
Copy link

agirorn commented Jul 1, 2016

I'm guessing that you are getting the rest of the arguments by accident since debug only outputs the first argument and inlines all other arguments based on format. #140 #190 #293

debug('format: %s -- %s', 'string 1', 'string 2') // -> 'format: -- string 1 -- string 2'

You could fix your code with this:

error('1 %s %o', 2, [1, 2]); // -> 'app:error 1 2 [ 1, 2 ] +42s'

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

No branches or pull requests

5 participants