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

This module is abstract.

Subclasses must implement the abstract methods below.

Common interface that all log entry types must implement

Instance Method Summary collapse

Instance Method Details

#eventEvent

This method is abstract.

The event type of the log entry (JSON property: evt)

Returns:



24
# File 'lib/log_struct/log/interfaces/common_fields.rb', line 24

def event; end

#levelLevel

This method is abstract.

The log level (JSON property: lvl)

Returns:



28
# File 'lib/log_struct/log/interfaces/common_fields.rb', line 28

def level; end

#serialize(strict = true) ⇒ Hash{Symbol => T.untyped}

This method is 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

Parameters:

  • strict (Boolean) (defaults to: true)

Returns:

  • (Hash{Symbol => T.untyped})


38
# File 'lib/log_struct/log/interfaces/common_fields.rb', line 38

def serialize(strict = true); end

#sourceSource

This method is abstract.

The source of the log entry (JSON property: src)

Returns:



20
# File 'lib/log_struct/log/interfaces/common_fields.rb', line 20

def source; end

#timestampTime

This method is abstract.

The timestamp of the log entry (JSON property: ts)

Returns:

  • (Time)


32
# File 'lib/log_struct/log/interfaces/common_fields.rb', line 32

def timestamp; end