2323import org .openqa .selenium .remote .tracing .empty .NullTracer ;
2424import org .openqa .selenium .remote .tracing .opentelemetry .OpenTelemetryTracer ;
2525
26- import java .io .*;
27- import java .util .*;
26+ import java .io .FileNotFoundException ;
27+ import java .io .FileOutputStream ;
28+ import java .io .OutputStream ;
29+ import java .io .UncheckedIOException ;
30+ import java .io .UnsupportedEncodingException ;
31+ import java .util .Arrays ;
32+ import java .util .Enumeration ;
2833import java .util .logging .Handler ;
2934import java .util .logging .Level ;
3035import java .util .logging .LogManager ;
@@ -34,10 +39,8 @@ public class LoggingOptions {
3439
3540 private static final Logger LOG = Logger .getLogger (LoggingOptions .class .getName ());
3641 private static final String LOGGING_SECTION = "logging" ;
37-
38- private Level level = Level .INFO ;
39-
4042 private final Config config ;
43+ private Level level = Level .INFO ;
4144
4245 public LoggingOptions (Config config ) {
4346 this .config = Require .nonNull ("Config" , config );
@@ -137,21 +140,21 @@ private void configureLogEncoding(Logger logger, String encoding, Handler handle
137140 }
138141 } catch (UnsupportedEncodingException e ) {
139142 message =
140- String .format ("Using the system default encoding. Unsupported encoding %s" , encoding );
143+ String .format ("Using the system default encoding. Unsupported encoding %s" , encoding );
141144 }
142145 logger .addHandler (handler );
143146 logger .log (Level .INFO , message );
144147 }
145148
146149 private OutputStream getOutputStream () {
147150 return config .get (LOGGING_SECTION , "log-file" )
148- .map (fileName -> {
149- try {
150- return (OutputStream ) new FileOutputStream (fileName );
151- } catch (FileNotFoundException e ) {
152- throw new UncheckedIOException (e );
153- }
154- })
155- .orElse (System .out );
151+ .map (fileName -> {
152+ try {
153+ return (OutputStream ) new FileOutputStream (fileName );
154+ } catch (FileNotFoundException e ) {
155+ throw new UncheckedIOException (e );
156+ }
157+ })
158+ .orElse (System .out );
156159 }
157160}
0 commit comments