Class: Ruby::JSONFormatter::Base
- Inherits:
-
Logger::Formatter
- Object
- Logger::Formatter
- Ruby::JSONFormatter::Base
- Includes:
- Logifyer::Common, Logifyer::Common::JSON
- Defined in:
- lib/logifyer/json_logifyer.rb
Constant Summary collapse
- ANSI_ESCAPE_REGEX =
/\e\[(?:\d+;\d+;?\d*|[\d\w])m/.freeze
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 Logifyer::Common::JSON
Methods included from Logifyer::Common
Constructor Details
#initialize(app = nil, ext = {}) {|@config| ... } ⇒ Base
Returns a new instance of Base.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/logifyer/json_logifyer.rb', line 15 def initialize(app = nil, ext = {}) @app = app @ext = ext.is_a?(Hash) ? ext : {ext_info: ext.inspect} @config = { level: :log_level, app: :application, timestamp: :timestamp } yield @config if block_given? end |
Instance Method Details
#call(severity, time, progname, message) ⇒ Object
27 28 29 30 |
# File 'lib/logifyer/json_logifyer.rb', line 27 def call(severity, time, progname, ) = strip_ansi_escape_codes() @event = build_event(, severity, time) end |