Comments (4)
I do not understand the question. The point of pretty printing is to format the ndjson into a human readable form. If you donβt care for the format this module generates, try another one like pino-colada
.
from pino-pretty.
I'm having this issue too. The problem is that if you pass in a merge object the properties get dropped onto a new line by default. I suspect the way to work around this is with a message format, but I can't seem to find any documentation of what the default format string is (the one that puts the time in brackets, and the pid in parentheses, etc). If I could find that, I suspect I could copy it and tweak it to do what I want with the properties on the merge object?
So I think the initial report was missing the actual logging invocation...
log.info({foo:"bar"},"message-n-stuff")
results in
[2023-10-17 18:06:12.345 -0400] INFO (45678) : message-n-stuff
foo: "bar"
from pino-pretty.
Lines 100 to 101 in 41fdd31
from pino-pretty.
Ok but I'm trying to make the program emit human readable logs at runtime...
I've seen that you have a format mechanism with {} and {if } but I'm not seeing anything that approaches what I'm used to in the java world: https://logging.apache.org/log4j/2.x/manual/layouts.html#PatternLayout
After reading some other tickets it sounds like the date/level/process ("metadata") is hard coded and there's no such thing as a "default format specifier"? is that a correct understanding?
I see an "ignore" option, so perhaps if I ignore everything and then supply a format, and then declare/write pretifiers maybe that's the way to get full control of the line?
Edit: I found the runtime version of these... so this is now drifting off topic. Probably ought to be moved to discussions (except it looks like you haven't enabled that).
from pino-pretty.
Related Issues (20)
- Logs missing in Jest tests HOT 5
- Couldn't log chinese character correctly HOT 1
- How to use transport with nestjs? HOT 1
- How do I change the time, I want it to carry the date instead of just the time HOT 1
- Remove reliance on worker_thread to enable working with wrangler (CF worker) HOT 1
- LevelName whitespace alignment issue HOT 3
- Pino-pretty doesn't work if timestamp is changed HOT 2
- Cannot find type definition file for pino-pretty while running npm run lint HOT 5
- PinoPretty.customPrettifiers() lacks arguments declared in type PinoPretty.Prettifier HOT 1
- Time zone does not match HOT 2
- `sync` doesn't work HOT 2
- Logging Error-like object causes crash
- Allow setting customPrettifiers from the cli HOT 2
- error.cause is not logged HOT 1
- TypeScript: "no call signatures" when using ESM
- Print the message in the same colour as the level HOT 1
- PNPM: Failed to create bin at ../node_modules/.bin/pino-pretty. HOT 1
- parseFactoryOptions is not a function. HOT 1
- incorrect url in readme (ndjson)
- Endless issues of Error: Cannot find module '....\.next\server\vendor-chunks\lib\worker.js HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pino-pretty.