Hi. I'm trying to use Ruby's built in logger to show messages with the
severity and timestamp, but I'm just getting the message string, (no
severity or timestamp).
Any suggestions?
(If possible, please cc all responses to me at listrecv at gmail,
thanks!)
harp:~ > ruby -r logger -e' Logger::new(STDOUT).info 42 '
I, [2005-11-13T17:51:50.496175 #5158] INFO -- : 42
harp:~ > ruby -r logger -e' Logger::new(STDOUT).info{ 42 } '
I, [2005-11-13T17:51:57.527556 #5159] INFO -- : 42
-a
···
On Mon, 14 Nov 2005 listrecv@gmail.com wrote:
Hi. I'm trying to use Ruby's built in logger to show messages with the
severity and timestamp, but I'm just getting the message string, (no
severity or timestamp).
Any suggestions?
(If possible, please cc all responses to me at listrecv at gmail,
thanks!)
NoMethodError: undefined method `formatter=' for #<Logger:0x5a04910>
from (irb):138
from :0
l.info 'try again'
try again
=> true
--
ara [dot] t [dot] howard [at] gmail [dot] com
all happiness comes from the desire for others to be happy. all misery
comes from the desire for oneself to be happy.
-- bodhicaryavatara
Hi. I'm trying to use Ruby's built in logger to show messages with the
severity and timestamp, but I'm just getting the message string, (no
severity or timestamp).
which ruby version? this certainly works for me:
It should be ruby-1.8.2 or earlier. Logger#formatter= is from ruby-1.8.3.
Unfortunately some library/application ruins original logger.rb.
Adding the following line may recover the original logger.rb definition
(with some warnings).