Skip to content

fix: pass --env.verbose to webpack compiler #4659

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/common/definitions/logger.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ declare global {
trace(formatStr?: any, ...args: any[]): void;
printMarkdown(...args: any[]): void;
prepare(item: any): string;
isVerbose(): boolean;
}

interface Log4JSAppenderConfiguration extends Configuration {
Expand Down
4 changes: 4 additions & 0 deletions lib/common/logger/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ export class Logger implements ILogger {
this.info(formattedMessage, { [LoggerConfigData.skipNewLine]: true });
}

public isVerbose(): boolean {
return log4js.levels.DEBUG.isGreaterThanOrEqualTo(this.getLevel());
}

private logMessage(inputData: any[], logMethod: string): void {
this.initialize();

Expand Down
1 change: 1 addition & 0 deletions lib/common/test/unit-tests/stubs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export class CommonLoggerStub implements ILogger {
printInfoMessageOnSameLine(message: string): void { }
async printMsgWithTimeout(message: string, timeout: number): Promise<void> { }
printOnStderr(formatStr?: any, ...args: any[]): void { }
isVerbose(): boolean { return false; }
}

export class ErrorsStub implements IErrors {
Expand Down
4 changes: 3 additions & 1 deletion lib/services/webpack/webpack-compiler-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,11 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp
const appResourcesPath = this.$projectData.getAppResourcesRelativeDirectoryPath();
Object.assign(envData,
appPath && { appPath },
appResourcesPath && { appResourcesPath }
appResourcesPath && { appResourcesPath },
);

envData.verbose = this.$logger.isVerbose();

return envData;
}

Expand Down
2 changes: 2 additions & 0 deletions test/stubs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export class LoggerStub implements ILogger {
printInfoMessageOnSameLine(message: string): void { }
async printMsgWithTimeout(message: string, timeout: number): Promise<void> { }
printOnStderr(formatStr?: any, ...args: any[]): void { }

isVerbose(): boolean { return false; }
}

export class FileSystemStub implements IFileSystem {
Expand Down