Class: LogPorter::Event
- Inherits:
-
Object
- Object
- LogPorter::Event
- Defined in:
- lib/logporter/event.rb
Instance Attribute Summary collapse
-
#hostname ⇒ Object
Returns the value of attribute hostname.
-
#message ⇒ Object
Returns the value of attribute message.
-
#pri ⇒ Object
Returns the value of attribute pri.
-
#raw ⇒ Object
Returns the value of attribute raw.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#time_iso8601 ⇒ Object
TODO(sissel): Should we include other source information like client address and port?.
- #to_s ⇒ Object
Instance Attribute Details
#hostname ⇒ Object
Returns the value of attribute hostname.
6 7 8 |
# File 'lib/logporter/event.rb', line 6 def hostname @hostname end |
#message ⇒ Object
Returns the value of attribute message.
7 8 9 |
# File 'lib/logporter/event.rb', line 7 def @message end |
#pri ⇒ Object
Returns the value of attribute pri.
4 5 6 |
# File 'lib/logporter/event.rb', line 4 def pri @pri end |
#raw ⇒ Object
Returns the value of attribute raw.
8 9 10 |
# File 'lib/logporter/event.rb', line 8 def raw @raw end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
5 6 7 |
# File 'lib/logporter/event.rb', line 5 def @timestamp end |
Instance Method Details
#time_iso8601 ⇒ Object
TODO(sissel): Should we include other source information like client address and port?
13 14 15 |
# File 'lib/logporter/event.rb', line 13 def time_iso8601 return .strftime("%Y-%m-%dT%H:%M:%S.") + .tv_usec.to_s end |
#to_s ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/logporter/event.rb', line 17 def to_s if @raw == true return else return "<#{pri}>#{time_iso8601} #{hostname} #{}" end end |