davetron5000/optparse-plus

Issue in documentation for CLILogger?

bachya opened this issue · 5 comments

In your documentation, you mention this as the method for writing to a file:

logger = CLILogger.new('logfile.txt')
logger.debug("Starting up") # => logfile.txt gets this
logger.error("Something went wrong!") # => BOTH logfile.txt AND the standard error get this

However, in Ruby 2.1.0., running this code returns this error message:

error: undefined method `tty?' for "logfile.txt":String

The following changes make it work:

logger CLILogger.new(File.open("logfile.txt", File::WRONLY|File::CREAT))

Not sure if this is intended, already-known, etc. – just wanted to make you aware of it. :)

Interesting. I don't think it's a 2.1 thing. Seems like Logger is OK with a filename, but CLILogger is not handling that properly.

Will look into fixing this.

Solid copy. Let me know if I can provide anything further.

once the build passes on Travis, I'll release a new version. Thanks for finding this!

fixed in 1.3.2

Nice work! Thank you!

---Sent from Boxer | http://getboxer.com

On February 23, 2014 at 9:25:37 AM MST, David Copeland notifications@github.com wrote:once the build passes on Travis, I'll release a new version. Thanks for finding this! —Reply to this email directly or view it on GitHub.