[#75225] [Ruby trunk Feature#12324] Support OpenSSL 1.1.0 (and drop support for 0.9.6/0.9.7) — k@...
Issue #12324 has been reported by Kazuki Yamaguchi.
6 messages
2016/04/27
[#78693] Re: [Ruby trunk Feature#12324] Support OpenSSL 1.1.0 (and drop support for 0.9.6/0.9.7)
— Eric Wong <normalperson@...>
2016/12/17
k@rhe.jp wrote:
[#78701] Re: [Ruby trunk Feature#12324] Support OpenSSL 1.1.0 (and drop support for 0.9.6/0.9.7)
— Kazuki Yamaguchi <k@...>
2016/12/17
On Sat, Dec 17, 2016 at 01:31:12AM +0000, Eric Wong wrote:
[#78702] Re: [Ruby trunk Feature#12324] Support OpenSSL 1.1.0 (and drop support for 0.9.6/0.9.7)
— Eric Wong <normalperson@...>
2016/12/17
Kazuki Yamaguchi <k@rhe.jp> wrote:
[ruby-core:74760] [Ruby trunk Bug#12238] Logger writes progname if log message is nil
From:
nobu@...
Date:
2016-04-01 05:30:00 UTC
List:
ruby-core #74760
Issue #12238 has been updated by Nobuyoshi Nakada.
Assignee set to Naotoshi Seo
Seems intended,
> Logger#add(severity, message = nil, progname = nil) { ... }
>
> ### Args
>
> `progname`::
> Program name string. Can be omitted. Treated as a message if no
> `message` and `block` are given.
but maybe a bug.
```diff
diff --git a/lib/logger.rb b/lib/logger.rb
index 8393806..9a05518 100644
--- a/lib/logger.rb
+++ b/lib/logger.rb
@@ -421,14 +421,16 @@
if @logdev.nil? or severity < @level
return true
end
- progname ||= @progname
if message.nil?
if block_given?
message = yield
+ progname ||= @progname
else
message = progname
progname = @progname
end
+ else
+ progname ||= @progname
end
@logdev.write(
format_message(format_severity(severity), Time.now, progname, message))
```
----------------------------------------
Bug #12238: Logger writes progname if log message is nil
https://bugs.ruby-lang.org/issues/12238#change-57890
* Author: Konstantin /
* Status: Open
* Priority: Normal
* Assignee: Naotoshi Seo
* ruby -v: ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
Please consider the following example:
``` ruby
logger = Logger.new($stdout)
# Log message is nil
logger.info
# I, [2016-03-31T22:04:36.684636 #4019] INFO -- : nil
logger.progname = 'prog'
# Now log message is changed to progname, is this a bug?
logger.info
# I, [2016-03-31T22:04:51.418510 #4019] INFO -- prog: prog
logger.info 'test'
# I, [2016-03-31T22:05:03.345434 #4019] INFO -- prog: test
```
Logger writes progname if log message is nil. Is this a bug or a known feature?
--
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>