Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* 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
  • Loading branch information...
commit c4827de949c6c1a940e1d3e48421397d01b0da8a 1 parent e641eba
@drbrain drbrain authored
Showing with 17 additions and 9 deletions.
  1. +6 −0 ChangeLog
  2. +11 −9 lib/logger.rb
View
6 ChangeLog
@@ -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.
View
20 lib/logger.rb
@@ -57,22 +57,24 @@
#
# 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
Please sign in to comment.
Something went wrong with that request. Please try again.