question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Passing multiple parameters to logging functions doesn't behave as expected

See original GitHub issue

Please tell us about your environment:

  • winston version?
    • winston@2
    • winston@3
  • node -v outputs: v8.11.3
  • Operating System? macOS
  • Language? Flow ES6/7

What is the problem?

With 3.x.x:

const winston = require('winston')

const logger = winston.createLogger({
	transports: [new winston.transports.Console()]
})

logger.info('test log', 'with a second parameter')

Outputs:

{"level":"info","message":"test log"}

With 2.x.x:

const winston = require('winston')

const logger = new winston.Logger({
	transports: [new winston.transports.Console()]
})

logger.info('test log', 'with a second parameter')

Outputs:

info: test log with a second parameter

What do you expect to happen instead?

It should output:

{"level":"info","message":"test log with a second parameter"}

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:93
  • Comments:49 (4 by maintainers)

github_iconTop GitHub Comments

31reactions
rjmunrocommented, Oct 4, 2018

This is a HUGE breaking change for us. If it is intentional, it should be detailed in https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md

24reactions
neillindbergcommented, Nov 20, 2019

I understand major versions introduce breaking changes, but my goodness…

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Pass a list to a function to act as multiple arguments
In a function that expects a list of items, how can I pass a Python list item without getting an error? my_list =...
Read more >
logging — Logging facility for Python — Python 3.11.1 ...
This module defines functions and classes which implement a flexible event logging system for applications and libraries. The key benefit of having the...
Read more >
The arguments object - JavaScript - MDN Web Docs - Mozilla
arguments is an Array-like object accessible inside functions that contains the values of the arguments passed to that function.
Read more >
Functions :: Eloquent JavaScript
If you don't provide it or pass the value undefined , it will default to two, and the function will behave like square...
Read more >
The 10 Most Common JavaScript Issues Developers Face
As a result, the anonymous function being passed to setTimeout() is being ... and doesn't work, the more solid your code will be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found