[java] Add logs to DriverServiceSessionFactory
import java.util.Set;
import java.util.function.Function;
import java.util.function.Predicate;
+import java.util.logging.Logger;
import java.util.stream.Stream;
import static org.openqa.selenium.remote.RemoteTags.CAPABILITIES;
public class DriverServiceSessionFactory implements SessionFactory {
+ private static final Logger LOG = Logger.getLogger(DriverServiceSessionFactory.class.getName());
+
private final Tracer tracer;
private final HttpClient.Factory clientFactory;
private final Duration sessionTimeout;
@@ -188,6 +191,8 @@ public void stop() {
EXCEPTION.accept(attributeMap, e);
String errorMessage = "Error while creating session with the driver service. "
+ "Stopping driver service: " + e.getMessage();
+ LOG.warning(errorMessage);
+
attributeMap.put(AttributeKey.EXCEPTION_MESSAGE.getKey(),
EventAttribute.setValue(errorMessage));
span.addEvent(AttributeKey.EXCEPTION_EVENT.getKey(), attributeMap);
@@ -199,6 +204,8 @@ public void stop() {
span.setStatus(Status.CANCELLED);
EXCEPTION.accept(attributeMap, e);
String errorMessage = "Error while creating session with the driver service. " + e.getMessage();
+ LOG.warning(errorMessage);
+
attributeMap.put(AttributeKey.EXCEPTION_MESSAGE.getKey(),
EventAttribute.setValue(errorMessage));
span.addEvent(AttributeKey.EXCEPTION_EVENT.getKey(), attributeMap);
