[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Missing time and seviority in the log file

Prasad OVLN

7/24/2008 9:53:00 AM

[Note: parts of this message were removed to make it a legal post.]

Please help me in this matter

On 7/24/08, Prasad <saytoprasad@gmail.com> wrote:
>
> Hi all,
>
> I have following code in simple ruby file, this code is
> recording messages in the log file with time and seveority.
>
> $log = Logger.new('logger.txt')
> $log.level = Logger::DEBUG
> $log.datetime_format = "%H:%M:%S"
> $log.info("Watir Execution Starts")
> $log.debug("Halllow Worled!")
> $log.info("Achtung Achtung. The Train will leave from
> platform 9")
> $log.warn("no no no no no. you can't do this")
> $log.error("error error Danger Danger")
> $log.fatal("game over game over game over")
>
> I have placed above code in the class file as below. With this
> change, this code is not recording time and seriority in the log
> file, only messages are appearing.
> ===================================================
> require "test/unit"
> require 'Watir'
> require 'logger'
> include Watir
>
> class PublishersFlow < Test::Unit::TestCase
>
> def test_sample
>
> $log = Logger.new('logger.txt')
> $log.level = Logger::DEBUG
> $log.datetime_format = "%H:%M:%S"
> $log.info("Watir Execution Starts")
> $log.debug("Halllow Worled!")
> $log.info("Achtung Achtung. The Train will leave from
> platform 9")
> $log.warn("no no no no no. you can't do this")
> $log.error("error error Danger Danger")
> $log.fatal("game over game over game over")
> end
> end
>
> ====================================================================
>
> Does anybody help me in this case.
>
>
> Prasad
>