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