Module: LogStruct::Log::Interfaces::CommonFields Abstract
- Extended by:
- T::Helpers, T::Sig
- Included in:
- ActionMailer, ActiveJob, ActiveStorage, CarrierWave, Error, GoodJob, Plain, Request, SQL, Security, Shrine, Sidekiq
- Defined in:
- lib/log_struct/log/interfaces/common_fields.rb
Overview
Subclasses must implement the abstract
methods below.
Common interface that all log entry types must implement
Instance Method Summary collapse
-
#event ⇒ Event
abstract
The event type of the log entry (JSON property: evt).
-
#level ⇒ Level
abstract
The log level (JSON property: lvl).
-
#serialize(strict = true) ⇒ Hash{Symbol => T.untyped}
abstract
All logs must define a custom serialize method If the class is a T::Struct that responds to serialize then we can be sure we're getting symbols as keys and don't need to call #serialize.deep_symbolize_keys.
-
#source ⇒ Source
abstract
The source of the log entry (JSON property: src).
-
#timestamp ⇒ Time
abstract
The timestamp of the log entry (JSON property: ts).
Instance Method Details
#event ⇒ Event
The event type of the log entry (JSON property: evt)
24 |
# File 'lib/log_struct/log/interfaces/common_fields.rb', line 24 def event; end |
#level ⇒ Level
The log level (JSON property: lvl)
28 |
# File 'lib/log_struct/log/interfaces/common_fields.rb', line 28 def level; end |
#serialize(strict = true) ⇒ Hash{Symbol => T.untyped}
All logs must define a custom serialize method If the class is a T::Struct that responds to serialize then we can be sure we're getting symbols as keys and don't need to call #serialize.deep_symbolize_keys
38 |
# File 'lib/log_struct/log/interfaces/common_fields.rb', line 38 def serialize(strict = true); end |
#source ⇒ Source
The source of the log entry (JSON property: src)
20 |
# File 'lib/log_struct/log/interfaces/common_fields.rb', line 20 def source; end |
#timestamp ⇒ Time
The timestamp of the log entry (JSON property: ts)
32 |
# File 'lib/log_struct/log/interfaces/common_fields.rb', line 32 def ; end |