unjs / consola

🐨 Elegant Console Logger for Node.js and Browser
Other
6k stars 175 forks source link

🎨 Allow configuring consola to auto colorize the according to type #299

Open jd-solanki opened 4 months ago

jd-solanki commented 4 months ago

Describe the feature

Hi 👋🏻

I'm using consola in all of my project and in few of them I've to colorize the output text along with the type. For example with consola.info we'll get output like below:

image
consola.info('🚀 Utils loaded')

However, I want to colorize it like below when I use info:

image

(I've to write like this everywhere: consola.info(colorize('cyan', '🚀 Utils loaded')))

This will be same for error, warn, success, etc

Additional information

pi0 commented 3 months ago

Good idea. We can allow this opt-in per type (pr welcome)