Skip to content

Commit

Permalink
fix logger reference (#3103)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicosang authored and jeoliva committed Nov 11, 2019
1 parent ccd95e5 commit 24836f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/streaming/metrics/metrics/MetricsHandlerFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function MetricsHandlerFactory(config) {

config = config || {};
let instance;
const debug = config.debug;
const logger = config.debug ? config.debug.getLogger(instance) : {};

// group 1: key, [group 3: n [, group 5: type]]
let keyRegex = /([a-zA-Z]*)(\(([0-9]*)(\,\s*([a-zA-Z]*))?\))?/;
Expand Down Expand Up @@ -75,7 +75,7 @@ function MetricsHandlerFactory(config) {
);
} catch (e) {
handler = null;
debug.error(`MetricsHandlerFactory: Could not create handler for type ${matches[1]} with args ${matches[3]}, ${matches[5]} (${e.message})`);
logger.error(`MetricsHandlerFactory: Could not create handler for type ${matches[1]} with args ${matches[3]}, ${matches[5]} (${e.message})`);
}

return handler;
Expand Down
7 changes: 3 additions & 4 deletions src/streaming/metrics/reporting/ReportingFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ function ReportingFactory(config) {
};

const context = this.context;
const debug = config.debug;
const metricsConstants = config.metricsConstants;

let instance;
const logger = config.debug ? config.debug.getLogger(instance) : {};
const metricsConstants = config.metricsConstants;

function create(entry, rangeController) {
let reporting;
Expand All @@ -55,7 +54,7 @@ function ReportingFactory(config) {
reporting.initialize(entry, rangeController);
} catch (e) {
reporting = null;
debug.error(`ReportingFactory: could not create Reporting with schemeIdUri ${entry.schemeIdUri} (${e.message})`);
logger.error(`ReportingFactory: could not create Reporting with schemeIdUri ${entry.schemeIdUri} (${e.message})`);
}

return reporting;
Expand Down

0 comments on commit 24836f7

Please sign in to comment.