123456789_123456789_123456789_123456789_123456789_

Class: Selenium::WebDriver::LogEntry

Relationships & Source Files
Inherits: Object
Defined in: rb/lib/selenium/webdriver/common/log_entry.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(level, timestamp, message) ⇒ LogEntry

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/log_entry.rb', line 25

def initialize(level, timestamp, message)
  @level = level
  @timestamp = timestamp
  @message = message
end

Instance Attribute Details

#level (readonly)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/log_entry.rb', line 23

attr_reader :level, :timestamp, :message

#message (readonly)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/log_entry.rb', line 23

attr_reader :level, :timestamp, :message

#timestamp (readonly)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/log_entry.rb', line 23

attr_reader :level, :timestamp, :message

Instance Method Details

#as_json

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/log_entry.rb', line 31

def as_json(*)
  {
    'timestamp' => timestamp,
    'level' => level,
    'message' => message
  }
end

#time

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/log_entry.rb', line 43

def time
  Time.at timestamp / 1000
end

#to_s

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/log_entry.rb', line 39

def to_s
  "#{time} #{level}: #{message}"
end