Skip to content

Commit d277ab0

Browse files
chore: respect default logging level from webpack
1 parent a04d649 commit d277ab0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/BundleAnalyzerPlugin.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ class BundleAnalyzerPlugin {
3434
apply(compiler) {
3535
this.compiler = compiler;
3636

37+
// Respect default logging level from webpack
38+
const defaultLoggerLevel = compiler.options.infrastructureLogging && compiler.options.infrastructureLogging.level ? compiler.options.infrastructureLogging.level : this.opts.logLevel;
39+
this.logger = compiler.getInfrastructureLogger ? compiler.getInfrastructureLogger('webpack-bundle-analyzer') : new Logger(defaultLoggerLevel);
40+
3741
const done = (stats, callback) => {
3842
callback = callback || (() => {});
3943

0 commit comments

Comments
 (0)