pinojs / pino-pretty

🌲Basic prettifier for Pino log lines
MIT License
1.22k stars 147 forks source link

Support objects in options.customColors #487

Closed kindagonzo closed 5 months ago

kindagonzo commented 7 months ago

Documentation notes that options.customColors can be either a string or object but objects are not currently supported in the code. From index.d.ts: /**

This change permits either strings or objects to be used.

kindagonzo commented 7 months ago

Thanks for opening a PR! Can you please add a unit test?

Sure. I checked around in the test folder but I can't seem to find any tests referencing that function. Where would you like me to add a test?

mcollina commented 7 months ago

You can test it via prettyFactory (https://github.com/pinojs/pino-pretty/blob/9d89a596f492eb2efee1632f54be9bc9b93356f4/test/basic.test.js#L526) or add a new file altogether.

kindagonzo commented 7 months ago

Can you help me out? I added the test and can run the suite fine with npm run test or npm run ci: PinoPretty Success

However, the pre-commit hook fails: PinoPretty Fail

Any idea why?

kindagonzo commented 7 months ago

It seems to be a transient issue. I ran it a few times and was finally able to commit.