Class: Dunlop::NestedLogger::Entry

Inherits:
Object
  • Object
show all
Defined in:
app/services/dunlop/nested_logger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Entry

Returns a new instance of Entry.



145
146
147
148
149
150
# File 'app/services/dunlop/nested_logger.rb', line 145

def initialize(options)
  @severity = options[:severity]
  @datetime = options[:datetime] || Time.current
  @progname = options[:progname]
  @msg = options[:msg]
end

Instance Attribute Details

#datetimeObject (readonly)

Returns the value of attribute datetime.



143
144
145
# File 'app/services/dunlop/nested_logger.rb', line 143

def datetime
  @datetime
end

#msgObject (readonly)

Returns the value of attribute msg.



143
144
145
# File 'app/services/dunlop/nested_logger.rb', line 143

def msg
  @msg
end

#prognameObject (readonly)

Returns the value of attribute progname.



143
144
145
# File 'app/services/dunlop/nested_logger.rb', line 143

def progname
  @progname
end

#severityObject (readonly)

Returns the value of attribute severity.



143
144
145
# File 'app/services/dunlop/nested_logger.rb', line 143

def severity
  @severity
end

Instance Method Details

#to_entryObject



152
153
154
# File 'app/services/dunlop/nested_logger.rb', line 152

def to_entry
  Dunlop::NestedLogger.formatter.call(severity, datetime, progname, msg)
end