Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/18F/analytics-reporter i…
Browse files Browse the repository at this point in the history
…nto develop
  • Loading branch information
Xavier Metichecchia authored and Xavier Metichecchia committed Nov 8, 2023
2 parents e1c06bb + d2b33e6 commit fa8a5a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 1 addition & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@ Promise.each = async function (arr, fn) {
}

const logger = winston.createLogger({
level: 'info',
level: 'debug',
format: winston.format.json(),
transports: [new winston.transports.Console()],
});

const run = function(options = {}) {
if (options.debug || options.verbose) {
winston.transports.console.level = "debug"
}
const reports = _filterReports(options)
return Promise.each(reports, report => _runReport(report, options))
}
Expand Down
8 changes: 8 additions & 0 deletions src/google-analytics/credential-loader.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
const config = require("../config")
const winston = require('winston');
const logger = winston.createLogger({
level: 'info',
format: winston.format.json(),
transports: [new winston.transports.Console()],
});

global.analyticsCredentialsIndex = 0

const loadCredentials = () => {
const credentialData = JSON.parse(config.analytics_credentials)
logger.info('in loadCredentials credentialData:'+credentialData);
const credentialsArray = _wrapArray(credentialData)
const index = global.analyticsCredentialsIndex++ % credentialsArray.length
logger.info('in loadCredentials index:'+index);
return credentialsArray[index]
}

Expand Down

0 comments on commit fa8a5a2

Please sign in to comment.