Class: TwitterFriendly::Logger

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/twitter_friendly/logger.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Logger

Returns a new instance of Logger.



10
11
12
13
14
15
16
# File 'lib/twitter_friendly/logger.rb', line 10

def initialize(options = {})
  path = options[:log_dir] || File.join('log')
  FileUtils.mkdir_p(path) unless File.exists?(path)

  @logger = ::Logger.new(File.join(path, 'twitter_friendly.log'))
  @logger.level = options[:log_level] || :debug
end