Class: Escort::Logger
- Inherits:
-
Object
- Object
- Escort::Logger
- Defined in:
- lib/escort/logger.rb
Class Method Summary collapse
Class Method Details
.close ⇒ Object
6 7 8 9 |
# File 'lib/escort/logger.rb', line 6 def close error.close output.close end |
.error ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/escort/logger.rb', line 11 def error @error_logger ||= ::Logger.new($stderr).tap do |l| #l.formatter = advanced_error_formatter l.formatter = basic_error_formatter l.sev_threshold = ::Logger::WARN end end |
.output ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/escort/logger.rb', line 19 def output @output_logger ||= ::Logger.new($stdout).tap do |l| l.formatter = output_formatter l.sev_threshold = ::Logger::DEBUG l.instance_eval do def puts( = nil, &block) if block_given? fatal(&block) else fatal( || "") end end end end end |
.setup_error_logger(auto_options) ⇒ Object
35 36 37 38 |
# File 'lib/escort/logger.rb', line 35 def setup_error_logger() error.formatter = send(:"#{.error_formatter}_error_formatter") error.sev_threshold = ::Logger.const_get(.verbosity) end |