Method: Sass::Logger::Base#capture
- Defined in:
- lib/sass/logger/base.rb
#capture
Captures all logger messages emitted during a block and returns them as a string.
27 28 29 30 31 32 33 34 |
# File 'lib/sass/logger/base.rb', line 27
def capture
old_io = io
self.io = StringIO.new
yield
io.string
ensure
self.io = old_io
end
|