mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[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:
parent
400878363b
commit
3964644ab4
4 changed files with 8 additions and 26 deletions
|
@ -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');
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
|
|
|
@ -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]);
|
||||
}
|
||||
}
|
||||
|
|
1
x-pack/legacy/plugins/reporting/types.d.ts
vendored
1
x-pack/legacy/plugins/reporting/types.d.ts
vendored
|
@ -48,7 +48,6 @@ export interface BrowserConfig {
|
|||
server: string;
|
||||
bypass?: string[];
|
||||
};
|
||||
verboseLogging?: boolean;
|
||||
}
|
||||
|
||||
export interface ElementPosition {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue