Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: When piping into jlv, colors are lost #105

Closed
kiesel opened this issue Oct 22, 2024 · 4 comments
Closed

bug: When piping into jlv, colors are lost #105

kiesel opened this issue Oct 22, 2024 · 4 comments

Comments

@kiesel
Copy link

kiesel commented Oct 22, 2024

When I run

$ some-command | jlv

I don't have colored log levels - different from when opening a file w/ jlv somelog.json.

Probably the interactive terminal detection goes wrong due to stdin being used?

@kiesel kiesel changed the title When piping into jlv, colors are lost bug: When piping into jlv, colors are lost Oct 22, 2024
@hedhyw
Copy link
Owner

hedhyw commented Oct 23, 2024

could it be that some-command also uses colors?

Plain experiment:

echo '{"msg":"test","level":"debug"}' | jlv

@kiesel
Copy link
Author

kiesel commented Oct 23, 2024

The experiment yields jlv with colored debug; however, the original program does in fact only emit json logs, nothing else. It is a nodejs process.

This sample, though, also shows colors:

$ node -e 'console.log(JSON.stringify({msg: "test", level: "debug"})); console.log(JSON.stringify({msg:"error", level: "error"}));' | jlv

I will investigate the original script.

@hedhyw
Copy link
Owner

hedhyw commented Nov 16, 2024

Fixed in #113

@hedhyw hedhyw closed this as completed Nov 16, 2024
@kiesel
Copy link
Author

kiesel commented Nov 18, 2024

Awesome, I can confirm it works as expected now. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants