Skip to content

Commit

Permalink
chore(node-sdk): use warn log level when enabled plugin arent installed
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarchaud committed Sep 13, 2020
1 parent f824195 commit 6f1cd0b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/opentelemetry-node/src/instrumentation/PluginLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,13 @@ export class PluginLoader {
this._plugins.push(plugin);
// Enable each supported plugin.
return plugin.enable(exports, this.provider, this.logger, config);
} catch (e) {
this.logger.error(
`PluginLoader#load: could not load plugin ${modulePath} of module ${name}. Error: ${e.message}`
} catch (err) {
const logLevel =
err instanceof Error && err.message.match(/Cannot find module/)
? this.logger.warn
: this.logger.error;
logLevel(
`PluginLoader#load: could not load plugin ${modulePath} of module ${name}. Error: ${err.message}`
);
return exports;
}
Expand Down

0 comments on commit 6f1cd0b

Please sign in to comment.