diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-20 23:41:51 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-20 23:41:51 +0000 |
commit | c4827de949c6c1a940e1d3e48421397d01b0da8a (patch) | |
tree | b0826b64e44d0a0e0be2cb86a57fadaecbd49569 | |
parent | e641eba963470607e6d08f55a24bbf72a0edea3b (diff) | |
download | ruby-c4827de949c6c1a940e1d3e48421397d01b0da8a.tar.gz |
* lib/logger.rb: Updated example in Logger comment to match other
examples and fixed a bug. Patch by Marcus Stollsteimer.
[Bug #6759]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/logger.rb | 20 |
2 files changed, 17 insertions, 9 deletions
@@ -1,3 +1,9 @@ +Sat Jul 21 08:41:14 2012 Eric Hodel <drbrain@segment7.net> + + * lib/logger.rb: Updated example in Logger comment to match other + examples and fixed a bug. Patch by Marcus Stollsteimer. + [Bug #6759] + Fri Jul 20 17:20:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org> * random.c (rb_random_real): refine error message. diff --git a/lib/logger.rb b/lib/logger.rb index 3125ac2df0..3376cf8216 100644 --- a/lib/logger.rb +++ b/lib/logger.rb @@ -57,22 +57,24 @@ require 'monitor' # # require 'logger' # -# log = Logger.new(STDOUT) -# log.level = Logger::WARN +# logger = Logger.new(STDOUT) +# logger.level = Logger::WARN # -# log.debug("Created logger") -# log.info("Program started") -# log.warn("Nothing to do!") +# logger.debug("Created logger") +# logger.info("Program started") +# logger.warn("Nothing to do!") +# +# path = "a_non_existent_file" # # begin -# File.each_line(path) do |line| +# File.foreach(path) do |line| # unless line =~ /^(\w+) = (.*)$/ -# log.error("Line in wrong format: #{line}") +# logger.error("Line in wrong format: #{line.chomp}") # end # end # rescue => err -# log.fatal("Caught exception; exiting") -# log.fatal(err) +# logger.fatal("Caught exception; exiting") +# logger.fatal(err) # end # # Because the Logger's level is set to +WARN+, only the warning, error, and |