Class: Celluloid::LogEvent
- Inherits:
-
Object
- Object
- Celluloid::LogEvent
- Defined in:
- lib/celluloid/logging/log_event.rb
Overview
Wraps a single log event.
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#message ⇒ Object
Returns the value of attribute message.
-
#progname ⇒ Object
Returns the value of attribute progname.
-
#severity ⇒ Object
Returns the value of attribute severity.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(severity, message, progname, time = Time.now, &_block) ⇒ LogEvent
constructor
A new instance of LogEvent.
Constructor Details
#initialize(severity, message, progname, time = Time.now, &_block) ⇒ LogEvent
Returns a new instance of LogEvent.
6 7 8 9 10 11 12 13 14 |
# File 'lib/celluloid/logging/log_event.rb', line 6 def initialize(severity, , progname, time=Time.now, &_block) # This id should be ordered. For now relies on Celluloid::UUID to be ordered. # May want to use a generation/counter strategy for independence of uuid. @id = Internals::UUID.generate @severity = severity @message = block_given? ? yield : @progname = progname @time = time end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/celluloid/logging/log_event.rb', line 4 def id @id end |
#message ⇒ Object
Returns the value of attribute message.
4 5 6 |
# File 'lib/celluloid/logging/log_event.rb', line 4 def @message end |
#progname ⇒ Object
Returns the value of attribute progname.
4 5 6 |
# File 'lib/celluloid/logging/log_event.rb', line 4 def progname @progname end |
#severity ⇒ Object
Returns the value of attribute severity.
4 5 6 |
# File 'lib/celluloid/logging/log_event.rb', line 4 def severity @severity end |
#time ⇒ Object
Returns the value of attribute time.
4 5 6 |
# File 'lib/celluloid/logging/log_event.rb', line 4 def time @time end |
Instance Method Details
#<=>(other) ⇒ Object
16 17 18 |
# File 'lib/celluloid/logging/log_event.rb', line 16 def <=>(other) @id <=> other.id end |