Class: QueryOwl::FileLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/query_owl/file_logger.rb

Class Method Summary collapse

Class Method Details

.append(events) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/query_owl/file_logger.rb', line 6

def append(events)
  return if events.empty?

  path = QueryOwl.config.log_file
  return unless path

  File.open(path, "a") do |f|
    events.each { |e| f.puts(JSON.generate(serializable(e))) }
  end
end