fix: remove Logger from API (#192)
This commit is contained in:
@@ -205,10 +205,6 @@ public interface Browser {
|
||||
* Emulates {@code 'prefers-colors-scheme'} media feature, supported values are {@code 'light'}, {@code 'dark'}, {@code 'no-preference'}. See {@code page.emulateMedia(params)} for more details. Defaults to '{@code light}'.
|
||||
*/
|
||||
public ColorScheme colorScheme;
|
||||
/**
|
||||
* Logger sink for Playwright logging.
|
||||
*/
|
||||
public Logger logger;
|
||||
/**
|
||||
* Enables HAR recording for all pages into {@code recordHar.path} file. If not specified, the HAR is not recorded. Make sure to await {@code browserContext.close()} for the HAR to be saved.
|
||||
*/
|
||||
@@ -295,10 +291,6 @@ public interface Browser {
|
||||
this.colorScheme = colorScheme;
|
||||
return this;
|
||||
}
|
||||
public NewContextOptions withLogger(Logger logger) {
|
||||
this.logger = logger;
|
||||
return this;
|
||||
}
|
||||
public RecordHar setRecordHar() {
|
||||
this.recordHar = new RecordHar();
|
||||
return this.recordHar;
|
||||
@@ -487,10 +479,6 @@ public interface Browser {
|
||||
* Emulates {@code 'prefers-colors-scheme'} media feature, supported values are {@code 'light'}, {@code 'dark'}, {@code 'no-preference'}. See {@code page.emulateMedia(params)} for more details. Defaults to '{@code light}'.
|
||||
*/
|
||||
public ColorScheme colorScheme;
|
||||
/**
|
||||
* Logger sink for Playwright logging.
|
||||
*/
|
||||
public Logger logger;
|
||||
/**
|
||||
* Enables HAR recording for all pages into {@code recordHar.path} file. If not specified, the HAR is not recorded. Make sure to await {@code browserContext.close()} for the HAR to be saved.
|
||||
*/
|
||||
@@ -577,10 +565,6 @@ public interface Browser {
|
||||
this.colorScheme = colorScheme;
|
||||
return this;
|
||||
}
|
||||
public NewPageOptions withLogger(Logger logger) {
|
||||
this.logger = logger;
|
||||
return this;
|
||||
}
|
||||
public RecordHar setRecordHar() {
|
||||
this.recordHar = new RecordHar();
|
||||
return this.recordHar;
|
||||
|
||||
@@ -111,10 +111,6 @@ public interface BrowserType {
|
||||
* Close the browser process on SIGHUP. Defaults to {@code true}.
|
||||
*/
|
||||
public Boolean handleSIGHUP;
|
||||
/**
|
||||
* Logger sink for Playwright logging.
|
||||
*/
|
||||
public Logger logger;
|
||||
/**
|
||||
* Maximum time in milliseconds to wait for the browser instance to start. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout.
|
||||
*/
|
||||
@@ -180,10 +176,6 @@ public interface BrowserType {
|
||||
this.handleSIGHUP = handleSIGHUP;
|
||||
return this;
|
||||
}
|
||||
public LaunchOptions withLogger(Logger logger) {
|
||||
this.logger = logger;
|
||||
return this;
|
||||
}
|
||||
public LaunchOptions withTimeout(Integer timeout) {
|
||||
this.timeout = timeout;
|
||||
return this;
|
||||
@@ -440,10 +432,6 @@ public interface BrowserType {
|
||||
* Emulates {@code 'prefers-colors-scheme'} media feature, supported values are {@code 'light'}, {@code 'dark'}, {@code 'no-preference'}. See {@code page.emulateMedia(params)} for more details. Defaults to '{@code light}'.
|
||||
*/
|
||||
public ColorScheme colorScheme;
|
||||
/**
|
||||
* Logger sink for Playwright logging.
|
||||
*/
|
||||
public Logger logger;
|
||||
/**
|
||||
* Enables HAR recording for all pages into {@code recordHar.path} file. If not specified, the HAR is not recorded. Make sure to await {@code browserContext.close()} for the HAR to be saved.
|
||||
*/
|
||||
@@ -581,10 +569,6 @@ public interface BrowserType {
|
||||
this.colorScheme = colorScheme;
|
||||
return this;
|
||||
}
|
||||
public LaunchPersistentContextOptions withLogger(Logger logger) {
|
||||
this.logger = logger;
|
||||
return this;
|
||||
}
|
||||
public RecordHar setRecordHar() {
|
||||
this.recordHar = new RecordHar();
|
||||
return this.recordHar;
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.microsoft.playwright;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Playwright generates a lot of logs and they are accessible via the pluggable logger sink.
|
||||
* <p>
|
||||
*/
|
||||
public interface Logger {
|
||||
enum Severity { ERROR, INFO, VERBOSE, WARNING }
|
||||
class LogHints {
|
||||
/**
|
||||
* preferred logger color
|
||||
*/
|
||||
public String color;
|
||||
|
||||
public LogHints withColor(String color) {
|
||||
this.color = color;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Determines whether sink is interested in the logger with the given name and severity.
|
||||
* @param name logger name
|
||||
*/
|
||||
boolean isEnabled(String name, Severity severity);
|
||||
/**
|
||||
*
|
||||
* @param name logger name
|
||||
* @param message log message format
|
||||
* @param args message arguments
|
||||
* @param hints optional formatting hints
|
||||
*/
|
||||
void log(String name, Severity severity, String message, List<Object> args, LogHints hints);
|
||||
}
|
||||
|
||||
@@ -1079,10 +1079,14 @@ class NestedClass extends TypeDefinition {
|
||||
static {
|
||||
deprecatedOptions.add("Browser.newPage.options.videosPath");
|
||||
deprecatedOptions.add("Browser.newPage.options.videoSize");
|
||||
deprecatedOptions.add("Browser.newPage.options.logger");
|
||||
deprecatedOptions.add("Browser.newContext.options.videosPath");
|
||||
deprecatedOptions.add("Browser.newContext.options.videoSize");
|
||||
deprecatedOptions.add("Browser.newContext.options.logger");
|
||||
deprecatedOptions.add("BrowserType.launchPersistentContext.options.videosPath");
|
||||
deprecatedOptions.add("BrowserType.launchPersistentContext.options.videoSize");
|
||||
deprecatedOptions.add("BrowserType.launchPersistentContext.options.logger");
|
||||
deprecatedOptions.add("BrowserType.launch.options.logger");
|
||||
}
|
||||
|
||||
NestedClass(Element parent, String name, JsonObject jsonElement) {
|
||||
@@ -1196,6 +1200,7 @@ public class ApiGenerator {
|
||||
"ChromiumCoverage",
|
||||
"CDPSession",
|
||||
"FirefoxBrowser",
|
||||
"Logger",
|
||||
"WebKitBrowser"
|
||||
));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user