Class: Gitlab::QA::SystemLogs::LogTypes::Log
- Inherits:
-
Object
- Object
- Gitlab::QA::SystemLogs::LogTypes::Log
- Defined in:
- lib/gitlab/qa/system_logs/log_types/log.rb
Direct Known Subclasses
Rails::ApiLog, Rails::ApplicationLog, Rails::ExceptionLog, Rails::GraphqlLog
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, data) ⇒ Log
constructor
A new instance of Log.
- #summary ⇒ Object
- #summary_fields ⇒ Object
Constructor Details
#initialize(name, data) ⇒ Log
Returns a new instance of Log.
8 9 10 11 |
# File 'lib/gitlab/qa/system_logs/log_types/log.rb', line 8 def initialize(name, data) @name = name @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
13 14 15 |
# File 'lib/gitlab/qa/system_logs/log_types/log.rb', line 13 def data @data end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
13 14 15 |
# File 'lib/gitlab/qa/system_logs/log_types/log.rb', line 13 def name @name end |
Instance Method Details
#summary ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/gitlab/qa/system_logs/log_types/log.rb', line 24 def summary summary = {} summary_fields.each do |field| value = data[field] summary[field] = value unless value.nil? end summary end |
#summary_fields ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/gitlab/qa/system_logs/log_types/log.rb', line 15 def summary_fields [ :severity, :correlation_id, :time, :message ] end |