Sha256: c93bb27678d781c984577df43ccc157bea4b934d5647bae46fa10a3609d336fc

Contents?: true

Size: 589 Bytes

Versions: 9

Compression:

Stored size: 589 Bytes

Contents

module Celluloid
  # Wraps a single log event.
  class LogEvent
    attr_accessor :id, :severity, :message, :progname, :time

    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

    def <=>(other)
      @id <=> other.id
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
celluloid-essentials-0.20.5 lib/celluloid/logging/log_event.rb
celluloid-essentials-0.20.2.1 lib/celluloid/logging/log_event.rb
celluloid-essentials-0.20.2 lib/celluloid/logging/log_event.rb
celluloid-essentials-0.20.1.1 lib/celluloid/logging/log_event.rb
celluloid-essentials-0.20.1 lib/celluloid/logging/log_event.rb
celluloid-essentials-0.20.0 lib/celluloid/logging/log_event.rb
celluloid-essentials-0.20.0.pre17 lib/celluloid/logging/log_event.rb
celluloid-essentials-0.20.0.pre16 lib/celluloid/logging/log_event.rb
celluloid-essentials-0.20.0.pre15 lib/celluloid/logging/log_event.rb