class ChupaText::CaptureLogger
Public Class Methods
Source
# File lib/chupa-text/capture-logger.rb, line 20 def capture original_logger = ChupaText.logger begin output = [] ChupaText.logger = new(output) yield output ensure ChupaText.logger = original_logger end end
Source
# File lib/chupa-text/capture-logger.rb, line 33 def initialize(output) @output = output end
Public Instance Methods
Source
# File lib/chupa-text/capture-logger.rb, line 37 def debug(message=nil) @output << [:debu, message || yield] end
Source
# File lib/chupa-text/capture-logger.rb, line 49 def error(message=nil) @output << [:error, message || yield] end
Source
# File lib/chupa-text/capture-logger.rb, line 53 def fatal(message=nil) @output << [:fatal, message || yield] end
Source
# File lib/chupa-text/capture-logger.rb, line 41 def info(message=nil) @output << [:info, message || yield] end
Source
# File lib/chupa-text/capture-logger.rb, line 45 def warn(message=nil) @output << [:warn, message || yield] end