Class: Celluloid::LogEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/celluloid/logging/log_event.rb

Overview

Wraps a single log event.

Instance Attribute Summary collapse

Instance Method Summary collapse

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, message, 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 : message
  @progname = progname
  @time = time
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/celluloid/logging/log_event.rb', line 4

def id
  @id
end

#messageObject

Returns the value of attribute message.



4
5
6
# File 'lib/celluloid/logging/log_event.rb', line 4

def message
  @message
end

#prognameObject

Returns the value of attribute progname.



4
5
6
# File 'lib/celluloid/logging/log_event.rb', line 4

def progname
  @progname
end

#severityObject

Returns the value of attribute severity.



4
5
6
# File 'lib/celluloid/logging/log_event.rb', line 4

def severity
  @severity
end

#timeObject

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