[#74190] [Ruby trunk Feature#12134] Comparison between `true` and `false` — duerst@...
Issue #12134 has been updated by Martin D端rst.
3 messages
2016/03/07
[#74269] Type systems for Ruby — Rob Blanco <ml@...>
Dear ruby-core,
5 messages
2016/03/10
[#74395] [Ruby trunk Feature#12142] Hash tables with open addressing — shyouhei@...
Issue #12142 has been updated by Shyouhei Urabe.
3 messages
2016/03/17
[ruby-core:74614] [Ruby trunk Feature#12224] logger: Allow specifying log level in constructor
From:
k@...
Date:
2016-03-28 06:41:15 UTC
List:
ruby-core #74614
Issue #12224 has been reported by Kazuki Yamaguchi. ---------------------------------------- Feature #12224: logger: Allow specifying log level in constructor https://bugs.ruby-lang.org/issues/12224 * Author: Kazuki Yamaguchi * Status: Open * Priority: Normal * Assignee: ---------------------------------------- When I use Logger class, I very often (or maybe always) set minimal log level together. Since method chaining can't be used for setters, we have to split it into two statements: ~~~ruby logger = Logger.new($stdout) logger.level = :info ~~~ Imagine if the `logger` was much longer name, such as ActiveRecord::Base.logger. I personally don't want to repeat it. I found a number of samples on GitHub (they would countain copy-and-pastes though) [1]. So I propose adding a new keyword argument `level` to Logger.new: ~~~ruby logger = Logger.new($stdout, level: :info) ~~~ This will be effectively same as the original code I indicated above. I attached a patch for this. [1] https://github.com/search?utf8=%E2%9C%93&q=%22%3D+Logger.new%22+%22level+%3D%22+language%3ARuby&type=Code&ref=searchresults ---Files-------------------------------- 0001-lib-logger.rb-allow-specifying-log-level-via-Logger..patch (2.25 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>