Sha256: 109e6cdfe2e689ce87723f5529eea83f00769d054cf8123a363f75475556db71
Contents?: true
Size: 562 Bytes
Versions: 35
Compression:
Stored size: 562 Bytes
Contents
require "logger" module Algolia class LoggerHelper # @param debug_file [nil|String] file used to output the logs # def self.create(debug_file = nil) file = debug_file if file.nil? && ENV["ALGOLIA_DEBUG"] begin file = File.new("debug.log", "a+") rescue Errno::EACCES, Errno::ENOENT => e puts("Failed to open debug.log: #{e.message}. Falling back to $stderr.") end end instance = ::Logger.new(file || $stderr) instance.progname = "algolia" instance end end end
Version data entries
35 entries across 35 versions & 1 rubygems