[ruby-core:74890] [Ruby trunk Bug#12238] Logger writes progname if log message is nil

From: konstantin@...
Date: 2016-04-12 09:46:03 UTC
List: ruby-core #74890
Issue #12238 has been updated by Konstantin /.


Thanks

I see that it is supposed to be like this. Seems a bit weird though.

----------------------------------------
Bug #12238: Logger writes progname if log message is nil
https://bugs.ruby-lang.org/issues/12238#change-58017

* 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>

In This Thread

Prev Next