Class: Teakflake::FileLogWriter
- Inherits:
-
Object
- Object
- Teakflake::FileLogWriter
- Defined in:
- lib/teakflake/server.rb
Instance Method Summary collapse
- #call(level_name, event_type, merged_data) ⇒ Object
-
#initialize(file_path) ⇒ FileLogWriter
constructor
A new instance of FileLogWriter.
Constructor Details
#initialize(file_path) ⇒ FileLogWriter
Returns a new instance of FileLogWriter.
28 29 30 |
# File 'lib/teakflake/server.rb', line 28 def initialize(file_path) @file_path = file_path end |
Instance Method Details
#call(level_name, event_type, merged_data) ⇒ Object
32 33 34 35 36 |
# File 'lib/teakflake/server.rb', line 32 def call(level_name, event_type, merged_data) merged_data[:level] = level_name merged_data[:event_type] = event_type File.open(@file_path, 'a') { |f| f.write("#{JSON.generate(merged_data)}\n") } end |