Class: Nanite::Log

Inherits:
Object show all
Defined in:
lib/nanite/log.rb

Instance Method Summary collapse

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(options, identity)
  @file = File.join((options[:log_dir] || options[:root] || Dir.pwd), "nanite.#{identity}.log")
  @logger = Logger.new(file)
  @logger.level = log_level(options[: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

#fileObject



9
10
11
# File 'lib/nanite/log.rb', line 9

def file
  @file
end