Class: RubyJSONFormatter::Base
- Inherits:
-
Logger::Formatter
- Object
- Logger::Formatter
- RubyJSONFormatter::Base
- Defined in:
- lib/log_formatter/ruby_json_formatter.rb
Instance Method Summary collapse
- #call(severity, time, progname, message) ⇒ Object
-
#initialize(app = nil, ext = {}) {|@config| ... } ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(app = nil, ext = {}) {|@config| ... } ⇒ Base
Returns a new instance of Base.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/log_formatter/ruby_json_formatter.rb', line 7 def initialize(app = nil, ext = {}) @app = app @ext = ext.is_a?(Hash) ? ext : {} @config = { level: :log_level, type: :log_type, app: :log_app, timestamp: :log_timestamp } yield @config if block_given? end |
Instance Method Details
#call(severity, time, progname, message) ⇒ Object
20 21 22 |
# File 'lib/log_formatter/ruby_json_formatter.rb', line 20 def call(severity, time, progname, ) @event = build_event(, severity, time, progname) end |