Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion java/src/org/openqa/selenium/grid/log/LoggingOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.io.UnsupportedEncodingException;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.List;
import java.util.Locale;
import java.util.logging.Handler;
import java.util.logging.Level;
Expand All @@ -49,6 +50,17 @@ public class LoggingOptions {
private final Config config;
private Level level = Level.INFO;
public static final String DEFAULT_LOG_TIMESTAMP_FORMAT = "HH:mm:ss.SSS";
private static final List<Level> DEFAULT_LOG_LEVELS =
Arrays.asList(
Level.ALL,
Level.INFO,
Level.CONFIG,
Level.FINE,
Level.FINER,
Level.FINEST,
Level.OFF,
Level.SEVERE,
Level.WARNING);

public LoggingOptions(Config config) {
this.config = Require.nonNull("Config", config);
Expand Down Expand Up @@ -76,7 +88,15 @@ public void setLoggingLevel() {
try {
level = Level.parse(configLevel.toUpperCase(Locale.ROOT));
} catch (IllegalArgumentException e) {
throw new ConfigException("Unable to determine log level from " + configLevel);
// Logger is not configured yet
new ConfigException(
"Unable to determine log level from "
+ configLevel
+ ". Using default "
+ DEFAULT_LOG_LEVEL
+ ". Available log levels are: "
+ DEFAULT_LOG_LEVELS)
.printStackTrace();
}
}

Expand Down
Loading