mahnunchik / gulp-responsive

gulp-responsive generates images at different sizes
https://npmjs.com/gulp-responsive
MIT License
503 stars 60 forks source link

New option: silent mode #35

Closed adamkiss closed 8 years ago

adamkiss commented 8 years ago

Hi,

thanks for this great gulp plugin. Unfortunately, it's far too talkative for me :smile:, so I added a 'silent' option. And since I'd like to have at least some feedback, I added a 'totals' output.

Changes:

All tests pass (well, except --webp, because I don't have libvips with webp compiled), and the silent mode must be activated (original verbose mode is the default mode) so it's completely backwards compatible.

mahnunchik commented 8 years ago

Hi @adamkiss

Thanks for your PR.

I have some points to be discussed:

adamkiss commented 8 years ago

Hm, I'm okay with that. I'd like to have current silent+warn option, but didn't want to introduce too many changes.

How would you like to proceed? verbosity string with multiple values (silent, warn, all), or multiple boolean options?

(in the code, I think we'll parse the string or subset of options into booleans anyway.

mahnunchik commented 8 years ago

In general it is not logging levels so I don't see any reason to introduce verbosity string.

I prefer to have two boolean options:

adamkiss commented 8 years ago

Well, it is logging, except not to file, but stdout.

I'll look into the upscale warns to see if I think it's a meaningful option, otherwise I'll just add a showStats option, which will be true by default.

adamkiss commented 8 years ago

Right, so I added options.stats and options.silent with default values as we agreed, and added a notes about them to readme.

All tests pass, so check it out, and if it's okay, bump & release.

👍🏻

(edit: I mistakingly comitted my preferred settings. Fixed)

mahnunchik commented 8 years ago

Hi @adamkiss

Thanks you! Landed in version 2.2.0.

I really like the statistics :wink:

[22:45:20] gulp-responsive: Created 73 images (matched 10 of 23 images)