adamduncan / eleventy-plugin-i18n

Eleventy plugin to assist with internationalization and dictionary translations
MIT License
104 stars 10 forks source link

Simplest quite mode implementation for plugin #19

Open imanbee opened 3 years ago

imanbee commented 3 years ago

Hi @adamduncan! First of all, thank you for your plugin! Works great :) Quiet mode is a need for me, so I'm proposing simplest flag to have an ability to suppress warnings / errors in console. I know it can be improved as option to choose between warnings and errors or even all output, so please let me know what is your vision regarding this option.

adamduncan commented 3 years ago

Thanks @imanbee 👍

Will put some thought into the API here. quietMode: true certainly does the job, as intended with #15.

I wonder if there's some preexisting logLevel Node convention that might be preferable? 🤔

imanbee commented 2 years ago

Usually Node.js uses one of these options to set logLevel : trace/debug/info/warn/error. If we want to use same convention, that "fallback" locales output should be visible only for logLevel: "warn" and not for `logLevel: "error"'. So I think only these two options might be available at the moment, however in the future you can always extend for any "lower" level of logging

imanbee commented 2 years ago

And we can possibly use https://www.npmjs.com/package/loglevel package to control current logLevel and automatically disable logging which has lower level