prettyPrint does not work well with multiple servers
See original GitHub issueI 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:
- Created 6 years ago
- Comments:9 (8 by maintainers)
Top 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 >
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 Free
Top 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
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 😃
It is this one: https://github.com/mcollina/split2#ndj---newline-delimited-json