eleventy-plugin-i18n icon indicating copy to clipboard operation
eleventy-plugin-i18n copied to clipboard

Simplest quite mode implementation for plugin

Open imanbee opened this issue 3 years ago • 3 comments

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.

imanbee avatar Sep 20 '21 08:09 imanbee

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? 🤔

adamduncan avatar Oct 07 '21 10:10 adamduncan

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 avatar Nov 30 '21 17:11 imanbee

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

imanbee avatar Nov 30 '21 18:11 imanbee