[Reporting] Ensure Chromium is always launched with args to create chrome_debug.log (#45479) (#46406)

* remove isVerbose from logger object

* Remove verboseLogging from chromium args

* fix typescript
This commit is contained in:
Tim Sullivan 2019-09-25 09:24:04 -07:00 committed by GitHub
parent 400878363b
commit 3964644ab4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 26 deletions

View file

@ -11,16 +11,9 @@ interface LaunchArgs {
viewport: BrowserConfig['viewport'];
disableSandbox: BrowserConfig['disableSandbox'];
proxy: BrowserConfig['proxy'];
verboseLogging: BrowserConfig['verboseLogging'];
}
export const args = ({
userDataDir,
viewport,
disableSandbox,
proxy: proxyConfig,
verboseLogging,
}: LaunchArgs) => {
export const args = ({ userDataDir, viewport, disableSandbox, proxy: proxyConfig }: LaunchArgs) => {
const flags = [
// Disable built-in Google Translate service
'--disable-translate',
@ -59,11 +52,9 @@ export const args = ({
flags.push('--no-sandbox');
}
// TODO remove conditional
if (verboseLogging) {
flags.push('--enable-logging');
flags.push('--v=1');
}
// log to chrome_debug.log
flags.push('--enable-logging');
flags.push('--v=1');
if (process.platform === 'linux') {
flags.push('--disable-setuid-sandbox');

View file

@ -54,7 +54,6 @@ export class HeadlessChromiumDriverFactory {
const chromiumArgs = args({
userDataDir,
viewport,
verboseLogging: true,
disableSandbox: this.browserConfig.disableSandbox,
proxy: this.browserConfig.proxy,
});
@ -91,7 +90,6 @@ export class HeadlessChromiumDriverFactory {
const chromiumArgs = args({
userDataDir,
viewport,
verboseLogging: this.logger.isVerbose,
disableSandbox: this.browserConfig.disableSandbox,
proxy: this.browserConfig.proxy,
});

View file

@ -13,19 +13,17 @@ const trimStr = (toTrim: string) => {
export class LevelLogger {
private _logger: any;
private _tags: string[];
private _isVerbose: boolean;
public warn: (msg: string, tags?: string[]) => void;
static createForServer(server: any, tags: string[], isVerbose = false) {
static createForServer(server: any, tags: string[]) {
const serverLog: ServerLog = (tgs: string[], msg: string) => server.log(tgs, msg);
return new LevelLogger(serverLog, tags, isVerbose);
return new LevelLogger(serverLog, tags);
}
constructor(logger: ServerLog, tags: string[], isVerbose: boolean) {
constructor(logger: ServerLog, tags: string[]) {
this._logger = logger;
this._tags = tags;
this._isVerbose = isVerbose;
/*
* This shortcut provides maintenance convenience: Reporting code has been
@ -50,11 +48,7 @@ export class LevelLogger {
this._logger([...this._tags, ...tags, 'info'], trimStr(msg));
}
public get isVerbose() {
return this._isVerbose;
}
public clone(tags: string[]) {
return new LevelLogger(this._logger, [...this._tags, ...tags], this._isVerbose);
return new LevelLogger(this._logger, [...this._tags, ...tags]);
}
}

View file

@ -48,7 +48,6 @@ export interface BrowserConfig {
server: string;
bypass?: string[];
};
verboseLogging?: boolean;
}
export interface ElementPosition {