Class: Algolia::LoggerHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/algolia/logger_helper.rb

Class Method Summary collapse

Class Method Details

.create(debug_file = nil) ⇒ Object

Parameters:

  • debug_file (nil|String) (defaults to: nil)

    file used to output the logs



7
8
9
10
11
12
# File 'lib/algolia/logger_helper.rb', line 7

def self.create(debug_file = nil)
  file = debug_file || (ENV["ALGOLIA_DEBUG"] ? File.new("debug.log", "a+") : $stderr)
  instance = ::Logger.new(file)
  instance.progname = "algolia"
  instance
end