Skip to content

Commit

Permalink
chore: respect default logging level from webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 committed Jun 18, 2020
1 parent a04d649 commit d277ab0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/BundleAnalyzerPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ class BundleAnalyzerPlugin {
apply(compiler) {
this.compiler = compiler;

// Respect default logging level from webpack
const defaultLoggerLevel = compiler.options.infrastructureLogging && compiler.options.infrastructureLogging.level ? compiler.options.infrastructureLogging.level : this.opts.logLevel;
this.logger = compiler.getInfrastructureLogger ? compiler.getInfrastructureLogger('webpack-bundle-analyzer') : new Logger(defaultLoggerLevel);

const done = (stats, callback) => {
callback = callback || (() => {});

Expand Down

0 comments on commit d277ab0

Please sign in to comment.