Git Product home page Git Product logo

Comments (4)

jsumners avatar jsumners commented on September 28, 2024

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.

nsoft avatar nsoft commented on September 28, 2024

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.

jsumners avatar jsumners commented on September 28, 2024

pino-pretty/Readme.md

Lines 100 to 101 in 41fdd31

- `--hideObject` (`-H`): Hide objects from output (but not error object)
- `--singleLine` (`-S`): Print each log message on a single line (errors will still be multi-line)

from pino-pretty.

nsoft avatar nsoft commented on September 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.