org.openqa.selenium.logging
Class LoggingPreferences

java.lang.Object
  extended by org.openqa.selenium.logging.LoggingPreferences

public class LoggingPreferences
extends Object

Represents the logging preferences. Sample usage: DesiredCapabilities caps = DesiredCapabilities.firefox(); LoggingPreferences logs = new LoggingPreferences(); logs.enable(LogType.DRIVER, Level.INFO); caps.setCapability(CapabilityType.LOGGING_PREFS, logs); WebDriver driver = new FirefoxDriver(caps);


Constructor Summary
LoggingPreferences()
           
 
Method Summary
 LoggingPreferences addPreferences(LoggingPreferences prefs)
          Adds the given logging preferences giving them precedence over existing preferences.
 void enable(String logType, Level level)
          Enables logging for the given log type at the specified level and above.
 Set<String> getEnabledLogTypes()
           
 Level getLevel(String logType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggingPreferences

public LoggingPreferences()
Method Detail

enable

public void enable(String logType,
                   Level level)
Enables logging for the given log type at the specified level and above.

Parameters:
logType - String the logType. Can be any of LogType.
level - Level the level.

getEnabledLogTypes

public Set<String> getEnabledLogTypes()
Returns:
the set of log types for which logging has been enabled.

getLevel

public Level getLevel(String logType)
Parameters:
logType - The log type.
Returns:
the Level for the given LogType if enabled. Otherwise returns Level.OFF.

addPreferences

public LoggingPreferences addPreferences(LoggingPreferences prefs)
Adds the given logging preferences giving them precedence over existing preferences.

Parameters:
prefs - The logging preferences to add.
Returns:
A references to this object.


Copyright © 2012. All Rights Reserved.