mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
e641eba963
commit
c4827de949
2 changed files with 17 additions and 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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue