Class: GrayLogger::Message

Inherits:
Object
  • Object
show all
Includes:
Support
Defined in:
lib/gray_logger/message.rb

Constant Summary collapse

RESERVED_KEYS =
%( short_message full_message version host timestamp level facility line file )

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Support

included

Constructor Details

#initialize(message_hash = {}) ⇒ Message

Returns a new instance of Message.



9
10
11
12
# File 'lib/gray_logger/message.rb', line 9

def initialize(message_hash={})
  @message_hash = message_hash
  @message = {}
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



7
8
9
# File 'lib/gray_logger/message.rb', line 7

def message
  @message
end

#message_hashObject (readonly)

Returns the value of attribute message_hash.



7
8
9
# File 'lib/gray_logger/message.rb', line 7

def message_hash
  @message_hash
end

Instance Method Details

#to_hashObject



14
15
16
17
18
# File 'lib/gray_logger/message.rb', line 14

def to_hash
  prepare_hash
  ensure_necessary_keys_are_present
  symbolize_keys(@message)
end