Print to log file without newline - Ruby on Rails -


i have logger print file:

logger = logger.new rails.root.join 'log/my.log' 

how can print several dots in 1 line in different logger calls?

i.e., if do

some_array.each |el|   logger.info '.'   el.some_method end 

these dots printed in different lines.

the << method lets write messages without formatting log file.

for example:

require 'logger'  log = logger.new "test.log" log.info "start" 5.times { log << "." } log << "\n" log.info "end" 

produces:

i, [2014-03-10t15:11:04.320495 #3410]  info -- : start ..... i, [2014-03-10t15:11:42.157131 #3410]  info -- : end 

unfortunately, doesn't let write same line previous calls log.info


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -