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 does not work well with multiple servers

See original GitHub issue

I instantiate 3 different servers and register hapi-pino into all 3 with prettyPrint=true, but only the first server to register will have pretty logs.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
ferraocommented, Jan 7, 2018

Problem is this line :

https://github.com/pinojs/hapi-pino/blob/8529345f330050302eb6b867b318a767dd604dcd/index.js#L36

Because I am registering the server multiple times with the same options object, after the first registration the original options object does not contain the prettyPrint flag enabled.

Its easy for me to supply a different options object on every registration, but I would argue that if the registration function alters the options object, then it should clone it internally to prevent this sort of problems, what do you think @mcollina ?

I have already made the necessary changes, but for some reason not obvious to me the tests are failing now. If you think this is the way to go I’ll put in an extra effort to fix them 😃

0reactions
mcollinacommented, Jan 10, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

PrettyPrint for logger doesn't work in v3 [TypeScript] #2388
Regression Report The logger doesn't accept anymore the prettyPrint option with TypeScript. Last working version Worked up to version: 2.8.0 ...
Read more >
Pretty print JSON output of Spring Boot Actuator endpoints
This works because Spring Boot uses an ObjectMapper bean to perform all the JSON related operations. Note however that this configuration will ......
Read more >
Prettify Your Data Structures With Pretty Print in Python
The pprint module, Python's data pretty printer, is a useful part of the standard library. You can work with it for debugging data...
Read more >
Python Pretty Print JSON [with 3 Examples] - codingem.com
Python pretty-printed JSON has indentations, spacings, and separators for your convenience. To pretty-print, call json.dumps(indent,separator)
Read more >
JSON Pretty Print using Python - GeeksforGeeks
JSON (JavaScript Object Notation) is a text-based data format that is interchangeable with many programming languages. It is commonly used ...
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