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.

PrettyPrint format function logging Symbols (level, message)

See original GitHub issue

This issue was previously reported on the main Winston issues list as #1308. Moving it here since the prettyPrint function is actually a part of this repository.

I’m running the sample code under the Combining Formats section. I’ve created a brand new Node project, and Winston is the only package installed. I created a new index.js file, and it only contains the code in the Combining Formats section. When I execute the code, I see the following log output:

{ level: 'info',
  message: 'What time is the testing at?',
  label: 'right meow!',
  timestamp: '2018-05-10T00:52:02.906Z',
  [Symbol(level)]: 'info' }

According to the text in the section, I should see:

{ level: 'info',
  message: 'What time is the testing at?',
  label: 'right meow!',
  timestamp: '2018-05-10T00:52:02.906Z' }

According to my testing (using the latest version of Winston), the [Symbol(level)]: 'info' part is coming from the prettyPrint function invocation. I looked at the function itself, and I couldn’t immediately see why it logged the Symbol portion. Is there a defect with the function or is it part of the configuration?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:23 (11 by maintainers)

github_iconTop GitHub Comments

8reactions
DABHcommented, Sep 21, 2018

Fixed at last on master, and will go out in the next npm release. Thanks all!

Note the fix is just for prettyPrint so if you see issues with other formatters feel free to open an issue or a similar PR to ^^

3reactions
Kaislecommented, Nov 2, 2018

When do you plan on releasing this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to remove [Symbol] fields from winston@3 logger output?
Use this function: removeSymbols(meta) { return Object.
Read more >
pprint — Data pretty printer — Python 3.11.1 documentation
The pprint module provides a capability to “pretty-print” arbitrary Python data structures in a form which can be used as input to the...
Read more >
A Complete Guide to Logging in Go with Zerolog - Better Stack
Each logger provides a method that corresponds to the seven log levels offered by Zerolog, which are listed below along with their integer ......
Read more >
filter and pretty-print Bunyan log file content - manpages.ubuntu!
Output options: --color Colorize output. Defaults to try if output stream is a TTY. --no-color Force no coloring (e.g. terminal doesn´t support it)...
Read more >
Configuring Logging - Quarkus
Special level for all messages including custom levels. ... is quarkus.log.console.format . The logging format string supports the following symbols: ...
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