[dev/cli] stop trimming log lines from the server (#87199)

Co-authored-by: spalger <spalger@users.noreply.github.com>
This commit is contained in:
Spencer 2021-01-04 14:01:30 -07:00 committed by GitHub
parent e9b43cdd3f
commit e8ecbc77a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View file

@ -25,7 +25,7 @@ export interface Log {
good(label: string, ...args: any[]): void;
warn(label: string, ...args: any[]): void;
bad(label: string, ...args: any[]): void;
write(label: string, ...args: any[]): void;
write(...args: any[]): void;
}
export class CliLog implements Log {
@ -58,9 +58,9 @@ export class CliLog implements Log {
console.log(Chalk.white.bgRed(` ${label.trim()} `), ...args);
}
write(label: string, ...args: any[]) {
write(...args: any[]) {
// eslint-disable-next-line no-console
console.log(` ${label.trim()} `, ...args);
console.log(...args);
}
}
@ -88,10 +88,10 @@ export class TestLog implements Log {
});
}
write(label: string, ...args: any[]) {
write(...args: any[]) {
this.messages.push({
type: 'write',
args: [label, ...args],
args,
});
}
}

View file

@ -191,8 +191,8 @@ it('is ready when optimizer phase is success or issue and logs in familiar forma
const lines = await linesPromise;
expect(lines).toMatchInlineSnapshot(`
Array [
"np bld log [timestamp] [success][@kbn/optimizer] 0 bundles compiled successfully after 0 sec",
"np bld log [timestamp] [error][@kbn/optimizer] webpack compile errors",
" np bld log [timestamp] [success][@kbn/optimizer] 0 bundles compiled successfully after 0 sec",
" np bld log [timestamp] [error][@kbn/optimizer] webpack compile errors",
]
`);
});

View file

@ -105,7 +105,7 @@ export class Optimizer {
ToolingLogTextWriter.write(
options.writeLogTo ?? process.stdout,
`${dim} log [${time()}] [${level(msg.type)}][${name}] `,
` ${dim} log [${time()}] [${level(msg.type)}][${name}] `,
msg
);
return true;