Class: Selenium::WebDriver::LogEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/webdriver/common/log_entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(level, timestamp, message) ⇒ LogEntry

Returns a new instance of LogEntry.



23
24
25
26
27
# File 'lib/selenium/webdriver/common/log_entry.rb', line 23

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

Instance Attribute Details

#levelObject (readonly)

Returns the value of attribute level.



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

def level
  @level
end

#messageObject (readonly)

Returns the value of attribute message.



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

def message
  @message
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



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

def timestamp
  @timestamp
end

Instance Method Details

#as_jsonObject



29
30
31
32
33
34
35
# File 'lib/selenium/webdriver/common/log_entry.rb', line 29

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

#timeObject



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

def time
  Time.at timestamp / 1000
end

#to_sObject



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

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