Monday, 22 September 2014

Loggers In Ruby



require 'logger'

logger = Logger.new($stdout)
logger.warn("This is a warning")
logger.info("This is an info")


//$stdout redirects all logs to console. If you want to redirect all this to a file then //need to initialize $stdout='/home/Aman_Test/log.txt', 'w'

No comments:

Post a Comment