weshatheleopard / rubyXL

Ruby lib for reading/writing/modifying .xlsx and .xlsm files
MIT License
1.27k stars 253 forks source link

An option to silence warnings #324

Closed kinkou closed 5 years ago

kinkou commented 5 years ago

Hi, please consider adding the option to silence warnings. Since the errors aren't critical it will be of use in production environments. The changes are in line with the way you treat the debug info, however I would suggest changing puts to warn and setting up a class-level config object, so something like RubyXL.settings.debug = true would be possible. What do you think?

weshatheleopard commented 5 years ago

@kinkou What is your use case? As in, in which case they constitute a problem for you?

kinkou commented 5 years ago

In my case RubyXL is a part of a script run remotely by cron, which emails back whatever output the commands produce. This behavior is convenient for monitoring: normally, output is produced only when the scripts fail (exceptions, etc.); in case of successful execution no output is produced. So whenever RubyXL puts, it generates an email. I think it would be nice to have an option to limit RubyXL to writing to output only in case of critical errors.

weshatheleopard commented 5 years ago

I added these changes to the gem.

kinkou commented 5 years ago

Solution 255d13f31ffef7d5d8cf75122bc66256e39815e5 Thank you