Skip to content

Commit

Permalink
[ftr] don't require the --no-debug flag to disable debug logging (#71535
Browse files Browse the repository at this point in the history
)

Co-authored-by: spalger <[email protected]>
  • Loading branch information
Spencer and spalger authored Jul 13, 2020
1 parent 5c3f8b9 commit 42cb6a4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 7 additions & 2 deletions packages/kbn-dev-utils/src/run/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { inspect } from 'util';
// @ts-ignore @types are outdated and module is super simple
import exitHook from 'exit-hook';

import { pickLevelFromFlags, ToolingLog } from '../tooling_log';
import { pickLevelFromFlags, ToolingLog, LogLevel } from '../tooling_log';
import { createFlagError, isFailError } from './fail';
import { Flags, getFlags, getHelp } from './flags';
import { ProcRunner, withProcRunner } from '../proc_runner';
Expand All @@ -38,6 +38,9 @@ type RunFn = (args: {
export interface Options {
usage?: string;
description?: string;
log?: {
defaultLevel?: LogLevel;
};
flags?: {
allowUnexpected?: boolean;
guessTypesForUnexpectedFlags?: boolean;
Expand All @@ -58,7 +61,9 @@ export async function run(fn: RunFn, options: Options = {}) {
}

const log = new ToolingLog({
level: pickLevelFromFlags(flags),
level: pickLevelFromFlags(flags, {
default: options.log?.defaultLevel,
}),
writeTo: process.stdout,
});

Expand Down
4 changes: 3 additions & 1 deletion packages/kbn-test/src/functional_test_runner/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ export function runFtrCli() {
}
},
{
log: {
defaultLevel: 'debug',
},
flags: {
string: [
'config',
Expand All @@ -126,7 +129,6 @@ export function runFtrCli() {
boolean: ['bail', 'invert', 'test-stats', 'updateBaselines', 'throttle', 'headless'],
default: {
config: 'test/functional/config.js',
debug: true,
},
help: `
--config=path path to a config file
Expand Down

0 comments on commit 42cb6a4

Please sign in to comment.