Passing multiple parameters to logging functions doesn't behave as expected
See original GitHub issuePlease 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:
- Created 5 years ago
- Reactions:93
- Comments:49 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
I understand major versions introduce breaking changes, but my goodness…