Package org.openqa.selenium.logging
Class LoggingPreferences
- java.lang.Object
-
- org.openqa.selenium.logging.LoggingPreferences
-
- All Implemented Interfaces:
java.io.Serializable
public class LoggingPreferences extends java.lang.Object implements java.io.SerializableRepresents 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);- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LoggingPreferences()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LoggingPreferencesaddPreferences(LoggingPreferences prefs)Adds the given logging preferences giving them precedence over existing preferences.voidenable(java.lang.String logType, java.util.logging.Level level)Enables logging for the given log type at the specified level and above.booleanequals(java.lang.Object o)java.util.Set<java.lang.String>getEnabledLogTypes()java.util.logging.LevelgetLevel(java.lang.String logType)inthashCode()java.util.Map<java.lang.String,java.lang.Object>toJson()
-
-
-
Method Detail
-
enable
public void enable(java.lang.String logType, java.util.logging.Level level)Enables logging for the given log type at the specified level and above.- Parameters:
logType- String the logType. Can be any ofLogType.level-Levelthe level.
-
getEnabledLogTypes
public java.util.Set<java.lang.String> getEnabledLogTypes()
- Returns:
- the set of log types for which logging has been enabled.
-
getLevel
public java.util.logging.Level getLevel(java.lang.String logType)
- Parameters:
logType- The log type.- Returns:
- the
Levelfor the givenLogTypeif enabled. Otherwise returnsLevel.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.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
toJson
@Beta public java.util.Map<java.lang.String,java.lang.Object> toJson()
-
-