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.



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

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

Instance Attribute Details

#levelObject (readonly)

Returns the value of attribute level.



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

def level
  @level
end

#messageObject (readonly)

Returns the value of attribute message.



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

def message
  @message
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



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

def timestamp
  @timestamp
end

Instance Method Details

#as_json(opts = nil) ⇒ Object



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

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

#timeObject



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

def time
  Time.at timestamp / 1000
end

#to_sObject



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

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