Class: Ruby::JSONFormatter::Base
- Inherits:
-
Logger::Formatter
- Object
- Logger::Formatter
- Ruby::JSONFormatter::Base
- Includes:
- LogFormatter::Common
- 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.
Methods included from LogFormatter::Common
#build_event, #current_time, #msg2str
Constructor Details
#initialize(app = nil, ext = {}) {|@config| ... } ⇒ Base
Returns a new instance of Base.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/log_formatter/ruby_json_formatter.rb', line 11 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
24 25 26 |
# File 'lib/log_formatter/ruby_json_formatter.rb', line 24 def call(severity, time, progname, ) @event = build_event(, severity, time, progname) end |