Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Log into a string var
io = StringIO.new
logger = Logger.new io
logger.info "foo"
io.string
=> "I, [2011-08-19T01:34:05.315739 #7354] INFO -- : foo\n"
logger.debug "bar"
io.string
=> "I, [2011-08-19T01:33:04.132831 #7354] INFO -- : foo\nD, [2011-08-19T01:33:08.836753 #7354] DEBUG -- : bar\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.