Class: LoggerConfigurer
- Inherits:
-
Object
- Object
- LoggerConfigurer
- Defined in:
- lib/web-scraper/logger_configurer.rb
Constant Summary collapse
- DEFAULT_FILENAME =
'web-scraper.log'
Class Method Summary collapse
Class Method Details
.create_logger(options = {}) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/web-scraper/logger_configurer.rb', line 7 def self.create_logger( = {}) @logger = Logger.new logger_device([:log_to_file]) @logger.level = [:log_level].to_i if [:log_level] @logger end |
.logger_device(file_option) ⇒ Object
14 15 16 17 18 |
# File 'lib/web-scraper/logger_configurer.rb', line 14 def self.logger_device(file_option) return nil if not file_option and ENV["WEBSCRAPER_ENV"] == 'test' file_option ? DEFAULT_FILENAME : STDOUT end |