[前][次][番号順一覧][スレッド一覧]

ruby-changes:42423

From: nobu <ko1@a...>
Date: Wed, 6 Apr 2016 09:59:42 +0900 (JST)
Subject: [ruby-changes:42423] nobu:r54497 (trunk): Logger: simple refactoring

nobu	2016-04-06 10:56:16 +0900 (Wed, 06 Apr 2016)

  New Revision: 54497

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54497

  Log:
    Logger: simple refactoring
    
    * lib/logger.rb (Logger#level=): remove unnecessary local
      variable.
    * lib/logger.rb (Logger#initialize, Logger#reopen): [DOC] mention
      the default values.  cherrypicked from [GH-1319].

  Modified files:
    trunk/ChangeLog
    trunk/lib/logger.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 54496)
+++ ChangeLog	(revision 54497)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Apr  6 10:56:15 2016  Anton Davydov  <antondavydov.o@g...>
+
+	* lib/logger.rb (Logger#level=): remove unnecessary local
+	  variable.
+
+	* lib/logger.rb (Logger#initialize, Logger#reopen): [DOC] mention
+	  the default values.  cherrypicked from [GH-1319].
+
 Wed Apr  6 10:17:53 2016  cremno phobia  <cremno@m...>
 
 	* math.c (ruby_lgamma_r): missing/lgamma_r.c is used on Windows,
Index: lib/logger.rb
===================================================================
--- lib/logger.rb	(revision 54496)
+++ lib/logger.rb	(revision 54497)
@@ -251,8 +251,7 @@ class Logger https://github.com/ruby/ruby/blob/trunk/lib/logger.rb#L251
     if severity.is_a?(Integer)
       @level = severity
     else
-      _severity = severity.to_s.downcase
-      case _severity
+      case severity.to_s.downcase
       when 'debug'.freeze
         @level = DEBUG
       when 'info'.freeze
@@ -335,9 +334,10 @@ class Logger https://github.com/ruby/ruby/blob/trunk/lib/logger.rb#L334
   #   +STDOUT+, +STDERR+, or an open file).
   # +shift_age+::
   #   Number of old log files to keep, *or* frequency of rotation (+daily+,
-  #   +weekly+ or +monthly+).
+  #   +weekly+ or +monthly+). Default value is 0.
   # +shift_size+::
-  #   Maximum logfile size (only applies when +shift_age+ is a number).
+  #   Maximum logfile size (only applies when +shift_age+ is a number). Default
+  #   value is 1MiB.
   #
   # === Description
   #
@@ -364,7 +364,8 @@ class Logger https://github.com/ruby/ruby/blob/trunk/lib/logger.rb#L364
   #
   # +logdev+::
   #   The log device.  This is a filename (String) or IO object (typically
-  #   +STDOUT+, +STDERR+, or an open file).
+  #   +STDOUT+, +STDERR+, or an open file).  reopen the same filename if
+  #   it is +nil+, do nothing for IO.  Default is +nil+.
   #
   # === Description
   #

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]