Class: Translatomatic::Logger
- Inherits:
-
Object
- Object
- Translatomatic::Logger
- Defined in:
- lib/translatomatic/logger.rb
Instance Attribute Summary collapse
-
#progressbar ⇒ Object
Returns the value of attribute progressbar.
Instance Method Summary collapse
- #finish ⇒ Object
-
#initialize ⇒ Logger
constructor
A new instance of Logger.
- #method_missing(name, *args) ⇒ Object
Constructor Details
#initialize ⇒ Logger
Returns a new instance of Logger.
4 5 6 7 8 9 10 |
# File 'lib/translatomatic/logger.rb', line 4 def initialize @logger = Logger.new(STDOUT) @logger.level = ENV['DEBUG'] ? Logger::DEBUG : Logger::INFO @logger.formatter = proc do |severity, datetime, progname, msg| "#{msg}\n" end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
12 13 14 |
# File 'lib/translatomatic/logger.rb', line 12 def method_missing(name, *args) handle_logger_method(name, args) if @logger.respond_to?(name) end |
Instance Attribute Details
#progressbar ⇒ Object
Returns the value of attribute progressbar.
2 3 4 |
# File 'lib/translatomatic/logger.rb', line 2 def end |
Instance Method Details
#finish ⇒ Object
16 17 18 |
# File 'lib/translatomatic/logger.rb', line 16 def finish .finish if end |