Skip to content

Commit

Permalink
Enable debug mode when DEBUG environment variable is set
Browse files Browse the repository at this point in the history
  • Loading branch information
p0deje committed Aug 16, 2017
1 parent f4bd516 commit dab663d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion rb/lib/selenium/webdriver/common/logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,21 @@ def deprecate(old, new)
def create_logger(output)
logger = ::Logger.new(output)
logger.progname = 'Selenium'
logger.level = ($DEBUG ? DEBUG : WARN)
logger.level = default_level
logger.formatter = proc do |severity, time, progname, msg|
"#{time.strftime('%F %T')} #{severity} #{progname} #{msg}\n"
end

logger
end

def default_level
if $DEBUG || ENV.key?('DEBUG')
DEBUG
else
WARN
end
end
end # Logger
end # WebDriver
end # Selenium

0 comments on commit dab663d

Please sign in to comment.