Class: Gallus::Event

Inherits:
Struct
  • Object
show all
Defined in:
lib/gallus/event.rb

Overview

Internal: Every log event is wrapped with this envelope. It holds information about the logger that performed the operation, log level, message (or object passed) and full payload. Also includes information at what time event has been recorded.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEvent

Returns a new instance of Event.



8
9
10
11
12
13
# File 'lib/gallus/event.rb', line 8

def initialize(*)
  super

  self.payload = Payload.new(payload || {})
  @recorded_at = Time.now.utc
end

Instance Attribute Details

#levelObject

Returns the value of attribute level

Returns:

  • (Object)

    the current value of level



5
6
7
# File 'lib/gallus/event.rb', line 5

def level
  @level
end

#loggerObject

Returns the value of attribute logger

Returns:

  • (Object)

    the current value of logger



5
6
7
# File 'lib/gallus/event.rb', line 5

def logger
  @logger
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



5
6
7
# File 'lib/gallus/event.rb', line 5

def message
  @message
end

#payloadObject

Returns the value of attribute payload

Returns:

  • (Object)

    the current value of payload



5
6
7
# File 'lib/gallus/event.rb', line 5

def payload
  @payload
end

#recorded_atObject (readonly)

Returns the value of attribute recorded_at.



6
7
8
# File 'lib/gallus/event.rb', line 6

def recorded_at
  @recorded_at
end