Class: LogStruct::Log::Puma::Start
- Inherits:
-
T::Struct
- Object
- T::Struct
- LogStruct::Log::Puma::Start
- Extended by:
- T::Sig
- Includes:
- Interfaces::AdditionalDataField, Interfaces::CommonFields, Shared::MergeAdditionalDataFields, Shared::SerializeCommon
- Defined in:
- lib/log_struct/log/puma/start.rb
Instance Attribute Summary collapse
-
#additional_data ⇒ Hash{String, Symbol => T.untyped}?
readonly
Returns the value of prop
additional_data. -
#environment ⇒ String?
readonly
Returns the value of prop
environment. -
#event ⇒ Event
readonly
Returns the value of prop
event. -
#level ⇒ Level
readonly
Returns the value of prop
level. -
#listening_addresses ⇒ Array<String>?
readonly
Returns the value of prop
listening_addresses. -
#max_threads ⇒ Integer?
readonly
Returns the value of prop
max_threads. -
#min_threads ⇒ Integer?
readonly
Returns the value of prop
min_threads. -
#mode ⇒ String?
readonly
Event-specific fields.
-
#process_id ⇒ Integer?
readonly
Returns the value of prop
process_id. -
#puma_codename ⇒ String?
readonly
Returns the value of prop
puma_codename. -
#puma_version ⇒ String?
readonly
Returns the value of prop
puma_version. -
#ruby_version ⇒ String?
readonly
Returns the value of prop
ruby_version. -
#source ⇒ Source::Puma
readonly
Shared/common fields.
-
#timestamp ⇒ Time
readonly
Returns the value of prop
timestamp.
Instance Method Summary collapse
- #initialize(source: Source::Puma, event: Event::Start, timestamp:, level: Level::Info, mode: nil, puma_version: nil, puma_codename: nil, ruby_version: nil, min_threads: nil, max_threads: nil, environment: nil, process_id: nil, listening_addresses: nil, additional_data: nil) ⇒ void constructor
- #to_h ⇒ Hash{LogStruct::LogField => T.untyped}
Methods included from Shared::SerializeCommon
#as_json, #serialize, #serialize_common
Methods included from Interfaces::CommonFields
Methods included from Shared::MergeAdditionalDataFields
Constructor Details
#initialize(source: Source::Puma, event: Event::Start, timestamp:, level: Level::Info, mode: nil, puma_version: nil, puma_codename: nil, ruby_version: nil, min_threads: nil, max_threads: nil, environment: nil, process_id: nil, listening_addresses: nil, additional_data: nil) ⇒ void
|
|
# File '' const :source, Source::Puma, default: Source::Puma const :event, Event, default: Event::Start const :timestamp, Time, factory: -> { Time.now } const :level, Level, default: Level::Info const :mode, T.nilable(String), default: nil const :puma_version, T.nilable(String), default: nil const :puma_codename, T.nilable(String), default: nil const :ruby_version, T.nilable(String), default: nil const :min_threads, T.nilable(Integer), default: nil const :max_threads, T.nilable(Integer), default: nil const :environment, T.nilable(String), default: nil const :process_id, T.nilable(Integer), default: nil const :listening_addresses, T.nilable(T::Array[String]), default: nil const :additional_data, T.nilable(T::Hash[T.any(String, Symbol), T.untyped]), default: nil |
Instance Attribute Details
#additional_data ⇒ Hash{String, Symbol => T.untyped}? (readonly)
Returns the value of prop additional_data.
|
|
# File '' const :additional_data, T.nilable(T::Hash[T.any(String, Symbol), T.untyped]), default: nil |
#environment ⇒ String? (readonly)
Returns the value of prop environment.
|
|
# File '' const :environment, T.nilable(String), default: nil |
#event ⇒ Event (readonly)
Returns the value of prop event.
|
|
# File '' const :event, Event, default: Event::Start |
#level ⇒ Level (readonly)
Returns the value of prop level.
|
|
# File '' const :level, Level, default: Level::Info |
#listening_addresses ⇒ Array<String>? (readonly)
Returns the value of prop listening_addresses.
|
|
# File '' const :listening_addresses, T.nilable(T::Array[String]), default: nil |
#max_threads ⇒ Integer? (readonly)
Returns the value of prop max_threads.
|
|
# File '' const :max_threads, T.nilable(Integer), default: nil |
#min_threads ⇒ Integer? (readonly)
Returns the value of prop min_threads.
|
|
# File '' const :min_threads, T.nilable(Integer), default: nil |
#mode ⇒ String? (readonly)
Event-specific fields
|
|
# File '' const :mode, T.nilable(String), default: nil |
#process_id ⇒ Integer? (readonly)
Returns the value of prop process_id.
|
|
# File '' const :process_id, T.nilable(Integer), default: nil |
#puma_codename ⇒ String? (readonly)
Returns the value of prop puma_codename.
|
|
# File '' const :puma_codename, T.nilable(String), default: nil |
#puma_version ⇒ String? (readonly)
Returns the value of prop puma_version.
|
|
# File '' const :puma_version, T.nilable(String), default: nil |
#ruby_version ⇒ String? (readonly)
Returns the value of prop ruby_version.
|
|
# File '' const :ruby_version, T.nilable(String), default: nil |
#source ⇒ Source::Puma (readonly)
Shared/common fields
|
|
# File '' const :source, Source::Puma, default: Source::Puma |
#timestamp ⇒ Time (readonly)
Returns the value of prop timestamp.
|
|
# File '' const :timestamp, Time, factory: -> { Time.now } |
Instance Method Details
#to_h ⇒ Hash{LogStruct::LogField => T.untyped}
53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/log_struct/log/puma/start.rb', line 53 def to_h h = T.let({}, T::Hash[LogStruct::LogField, T.untyped]) h[LogField::Mode] = mode unless mode.nil? h[LogField::PumaVersion] = puma_version unless puma_version.nil? h[LogField::PumaCodename] = puma_codename unless puma_codename.nil? h[LogField::RubyVersion] = ruby_version unless ruby_version.nil? h[LogField::MinThreads] = min_threads unless min_threads.nil? h[LogField::MaxThreads] = max_threads unless max_threads.nil? h[LogField::Environment] = environment unless environment.nil? h[LogField::ProcessId] = process_id unless process_id.nil? h[LogField::ListeningAddresses] = listening_addresses unless listening_addresses.nil? h end |