Class: Nanite::Log
Instance Method Summary collapse
- #file ⇒ Object
-
#initialize(options, identity) ⇒ Log
constructor
A new instance of Log.
- #method_missing(method, *args) ⇒ Object
Constructor Details
#initialize(options, identity) ⇒ Log
Returns a new instance of Log.
3 4 5 6 7 |
# File 'lib/nanite/log.rb', line 3 def initialize(, identity) @file = File.join(([:log_dir] || [:root] || Dir.pwd), "nanite.#{identity}.log") @logger = Logger.new(file) @logger.level = log_level([:log_level]) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
13 14 15 |
# File 'lib/nanite/log.rb', line 13 def method_missing(method, *args) @logger.send(method, *args) end |
Instance Method Details
#file ⇒ Object
9 10 11 |
# File 'lib/nanite/log.rb', line 9 def file @file end |