Skip to content

Commit 53ed43c

Browse files
committed
[java] let TracedCommandExecutor delegate NeedsLocalLogs calls
1 parent 2ad5abd commit 53ed43c

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

java/src/org/openqa/selenium/remote/RemoteWebDriver.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,11 @@ private Capabilities init(Capabilities capabilities) {
206206
converter = new JsonToWebElementConverter(this);
207207
executeMethod = new RemoteExecuteMethod(this);
208208

209-
Set<String> logTypesToInclude = Set.of();
209+
Set<String> logTypesToIgnore = Set.of();
210210

211-
LocalLogs performanceLogger = LocalLogs.getStoringLoggerInstance(logTypesToInclude);
211+
LocalLogs performanceLogger = LocalLogs.getStoringLoggerInstance(logTypesToIgnore);
212212
LocalLogs clientLogs =
213-
LocalLogs.getHandlerBasedLoggerInstance(LoggingHandler.getInstance(), logTypesToInclude);
213+
LocalLogs.getHandlerBasedLoggerInstance(LoggingHandler.getInstance(), logTypesToIgnore);
214214
localLogs = LocalLogs.getCombinedLogsHolder(clientLogs, performanceLogger);
215215
remoteLogs = new RemoteLogs(executeMethod, localLogs);
216216

java/src/org/openqa/selenium/remote/TracedCommandExecutor.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020
import java.io.IOException;
2121
import java.util.Map;
2222
import java.util.Objects;
23+
import org.openqa.selenium.logging.LocalLogs;
24+
import org.openqa.selenium.logging.NeedsLocalLogs;
2325
import org.openqa.selenium.remote.tracing.Span;
2426
import org.openqa.selenium.remote.tracing.Tracer;
2527

26-
public class TracedCommandExecutor implements CommandExecutor {
28+
public class TracedCommandExecutor implements CommandExecutor, NeedsLocalLogs {
2729

2830
private final CommandExecutor delegate;
2931
private final Tracer tracer;
@@ -51,4 +53,11 @@ public Response execute(Command command) throws IOException {
5153
return delegate.execute(command);
5254
}
5355
}
56+
57+
@Override
58+
public void setLocalLogs(LocalLogs logs) {
59+
if (delegate instanceof NeedsLocalLogs) {
60+
((NeedsLocalLogs) delegate).setLocalLogs(logs);
61+
}
62+
}
5463
}

0 commit comments

Comments
 (0)