Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
minilog.enable()
logInstance = minilog('client')
const existingErrorLogger = logInstance.error
logInstance.error = (err) => {
window.Rollbar.error(err)
existingErrorLogger(err)
}
} else {
let enableRollbar = false
if (process.env.NODE_ENV === 'production') {
enableRollbar = true
rollbar.init(process.env.ROLLBAR_ACCESS_TOKEN)
const options = {
exitOnUncaughtException: false
}
rollbar.handleUncaughtExceptions(process.env.ROLLBAR_ACCESS_TOKEN, options)
}
minilog.suggest.deny(/.*/, process.env.NODE_ENV === 'development' ? 'debug' : 'debug')
minilog.enable()
.pipe(minilog.backends.console.formatWithStack)
.pipe(minilog.backends.console)
logInstance = minilog('backend')
const existingErrorLogger = logInstance.error
logInstance.error = (err) => {
existingErrorLogger(err.stack ? err.stack : err)
try {
if (enableRollbar) {
if (typeof err === 'object') {
rollbar.handleError(err)
Import month-to-date DBRs, overwriting the existing month-to-date.
*******************************************************************************/
var util = require('util')
var log = require('loglevel')
var rollbar = require('rollbar')
var moment = require('moment')
var BaseParser = require('./lib/baseparser.js')
var DBR = require('./lib/dbr.js')
var Redshift = require('./lib/redshift.js')
var cliUtils = require('./lib/cliutils.js')
rollbar.init(process.env.ROLLBAR_TOKEN, {environment: process.env.ROLLBAR_ENVIRONMENT})
rollbar.handleUncaughtExceptions(process.env.ROLLBAR_TOKEN,
{exitOnUncaughtException: true})
var parser = new BaseParser({
version: '0.0.1',
addHelp: true,
description: 'Imports month-to-date detailed billing reports'
})
parser.addArgument(
['--no-stage'], {
action: 'storeConst',
dest: 'no_stage',
help: 'Use an existing staged month-to-date DBR.',
constant: true
}
)
Import finalized monthly DBRs.
*******************************************************************************/
var util = require('util')
var log = require('loglevel')
var rollbar = require('rollbar')
var moment = require('moment')
var BaseParser = require('./lib/baseparser.js')
var DBR = require('./lib/dbr.js')
var Redshift = require('./lib/redshift.js')
var cliUtils = require('./lib/cliutils.js')
rollbar.init(process.env.ROLLBAR_TOKEN, {environment: process.env.ROLLBAR_ENVIRONMENT})
rollbar.handleUncaughtExceptions(process.env.ROLLBAR_TOKEN,
{exitOnUncaughtException: true})
var parser = new BaseParser({
version: '0.0.1',
addHelp: true,
description: 'Imports finalized (whole-month) detailed billing reports'
})
parser.addArgument(
['--force'], {
action: 'storeConst',
dest: 'force',
help: 'Ignore existing DBRs in staging or redshift, and reimport them.',
constant: true
}
)