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

colorized formatted json for easier reading when running locally #17

Closed
hiro5id opened this issue Jan 3, 2020 · 7 comments
Closed

colorized formatted json for easier reading when running locally #17

hiro5id opened this issue Jan 3, 2020 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@hiro5id
Copy link
Owner

hiro5id commented Jan 3, 2020

No description provided.

@hiro5id hiro5id added the enhancement New feature or request label Jan 3, 2020
@hiro5id hiro5id self-assigned this May 14, 2021
@johhnsmmith198
Copy link

Fantastic library @hiro5id , I use it on all my projects! Thanks a lot.
please can you prioritise this work though? It's so difficult to read locally

@johhnsmmith198
Copy link

johhnsmmith198 commented Jul 27, 2022

wondering if you could allow a wrapper function (before the console.log) that can be defined in the user config.
Then the user could define a function that color the output like this one for instance: https://www.npmjs.com/package/json-colorizer

@johhnsmmith198
Copy link

actually winston has a color capability I think: https://www.npmjs.com/package/winston

@johhnsmmith198
Copy link

johhnsmmith198 commented Jul 27, 2022

I could do this as well to handle the coloring outside the nodejs process :

node src/index.js | jq -c

EDIT: but this is causing issues with handling Ctr-c so I can't use it

@hiro5id
Copy link
Owner Author

hiro5id commented Jul 28, 2022

I admit this is something that bugs me me for local development too. I'll need to look into this. But I do have a day job that takes a lot of time, even so I would enjoy implementing this kind of thing. However please know that if you can't wait, I am happy to accept a pull request.

@johhnsmmith198
Copy link

Hey @hiro5id , I can see you are back at it?
Are you considering this issue, please?

@hiro5id hiro5id pinned this issue Feb 8, 2023
@hiro5id
Copy link
Owner Author

hiro5id commented May 22, 2023

@johhnsmmith198 I have implemented colouring... starting v2.12.0 . The existing colours are not customizable yet, but I plan on allowing custom configs in following versions...
Enable it by defining environment variable CONSOLE_LOG_COLORIZE="true" it is, off by default because some log aggregators don't like colours, so it just introduces noise.

@hiro5id hiro5id closed this as completed May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants