Skip to content

Commit 39cccad

Browse files
authored
Merge pull request #4659 from NativeScript/fatme/verbose
fix: pass --env.verbose to webpack compiler
2 parents 2874b0b + cee7487 commit 39cccad

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

lib/common/definitions/logger.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ declare global {
2525
trace(formatStr?: any, ...args: any[]): void;
2626
printMarkdown(...args: any[]): void;
2727
prepare(item: any): string;
28+
isVerbose(): boolean;
2829
}
2930

3031
interface Log4JSAppenderConfiguration extends Configuration {

lib/common/logger/logger.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ export class Logger implements ILogger {
135135
this.info(formattedMessage, { [LoggerConfigData.skipNewLine]: true });
136136
}
137137

138+
public isVerbose(): boolean {
139+
return log4js.levels.DEBUG.isGreaterThanOrEqualTo(this.getLevel());
140+
}
141+
138142
private logMessage(inputData: any[], logMethod: string): void {
139143
this.initialize();
140144

lib/common/test/unit-tests/stubs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export class CommonLoggerStub implements ILogger {
5151
printInfoMessageOnSameLine(message: string): void { }
5252
async printMsgWithTimeout(message: string, timeout: number): Promise<void> { }
5353
printOnStderr(formatStr?: any, ...args: any[]): void { }
54+
isVerbose(): boolean { return false; }
5455
}
5556

5657
export class ErrorsStub implements IErrors {

lib/services/webpack/webpack-compiler-service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,11 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp
133133
const appResourcesPath = this.$projectData.getAppResourcesRelativeDirectoryPath();
134134
Object.assign(envData,
135135
appPath && { appPath },
136-
appResourcesPath && { appResourcesPath }
136+
appResourcesPath && { appResourcesPath },
137137
);
138138

139+
envData.verbose = this.$logger.isVerbose();
140+
139141
return envData;
140142
}
141143

test/stubs.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ export class LoggerStub implements ILogger {
4141
printInfoMessageOnSameLine(message: string): void { }
4242
async printMsgWithTimeout(message: string, timeout: number): Promise<void> { }
4343
printOnStderr(formatStr?: any, ...args: any[]): void { }
44+
45+
isVerbose(): boolean { return false; }
4446
}
4547

4648
export class FileSystemStub implements IFileSystem {

0 commit comments

Comments
 (0)