Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function RequestCaptureStream(opts) {
assert.object(opts, 'options');
assert.optionalObject(opts.stream, 'options.stream');
assert.optionalArrayOfObject(opts.streams, 'options.streams');
assert.optionalNumber(opts.level, 'options.level');
assert.optionalNumber(opts.maxRecords, 'options.maxRecords');
assert.optionalNumber(opts.maxRequestIds, 'options.maxRequestIds');
assert.optionalBool(opts.dumpDefault, 'options.dumpDefault');
var self = this;
Stream.call(this);
this.level = opts.level ? bunyan.resolveLevel(opts.level) : bunyan.WARN;
this.limit = opts.maxRecords || 100;
this.maxRequestIds = opts.maxRequestIds || 1000;
// eslint-disable-next-line new-cap
this.requestMap = LRU({
max: self.maxRequestIds
});
this.dumpDefault = opts.dumpDefault;
this._offset = -1;
this._rings = [];
this.streams = [];
if (opts.stream) {
appendStream(this.streams, opts.stream);
}
(function main() {
var _config;
var _options = parseOptions();
LOG.debug({options: _options}, 'command line options parsed');
_config = readConfig(_options);
LOG.debug({config: _config}, 'configuration loaded');
if (_config.logLevel && !LOG_LEVEL_OVERRIDE) {
if (bunyan.resolveLevel(_config.logLevel)) {
LOG.level(_config.logLevel);
}
}
// set loggers of the sub components
_config.log = LOG;
_config.postgresMgrCfg.log = LOG;
_config.postgresMgrCfg.zfsClientCfg.log = LOG;
_config.postgresMgrCfg.snapShotterCfg.log = LOG;
LOG.info('starting manatee');
var shard = Shard.start(_config);
StatusServer.start({
log: LOG,
port: _config.postgresPort + 1,
(function main() {
var _config;
var _options = parseOptions();
LOG.debug({options: _options}, 'command line options parsed');
_config = readConfig(_options);
LOG.debug({config: _config}, 'configuration loaded');
if (_config.logLevel && !LOG_LEVEL_OVERRIDE) {
if (bunyan.resolveLevel(_config.logLevel)) {
LOG.level(_config.logLevel);
}
}
_config.backupServerCfg.log = LOG;
_config.backupSenderCfg.log = LOG;
var backupServer = BackupServer.start(_config.backupServerCfg);
// server and sender share the same queue
_config.backupSenderCfg.queue = backupServer.getQueue();
BackupSender.start(_config.backupSenderCfg);
LOG.info('backupserver started');
})();
logger: function() {
if (!logger) {
logger = bunyan.createLogger({name: config.name});
if (process.env.NODE_MARKETO_LOG_LEVEL) {
logger.level(bunyan.resolveLevel(process.env.NODE_MARKETO_LOG_LEVEL));
}
}
return logger;
},
function RequestCaptureStream(opts) {
assert.object(opts, 'options');
assert.optionalObject(opts.stream, 'options.stream');
assert.optionalArrayOfObject(opts.streams, 'options.streams');
assert.optionalNumber(opts.level, 'options.level');
assert.optionalNumber(opts.maxRecords, 'options.maxRecords');
assert.optionalNumber(opts.maxRequestIds, 'options.maxRequestIds');
assert.optionalBool(opts.dumpDefault, 'options.dumpDefault');
var self = this;
Stream.call(this);
this.level = opts.level ? bunyan.resolveLevel(opts.level) : bunyan.WARN;
this.limit = opts.maxRecords || 100;
this.maxRequestIds = opts.maxRequestIds || 1000;
this.requestMap = new LRU({
max: self.maxRequestIds
});
this.dumpDefault = opts.dumpDefault;
this._offset = -1;
this._rings = [];
this.streams = [];
if (opts.stream) {
appendStream(this.streams, opts.stream);
}
enabled: function(level) {
return config.get('logging').enabled && (bunyan.resolveLevel(level) >= bunyan.resolveLevel(config.get('logging.level')));
},
streams: [ {
level: level,
type: 'raw',
stream: bsyslog.createBunyanStream({
name: NAME,
facility: facility,
host: cfg_b.syslog.host,
port: cfg_b.syslog.port,
type: cfg_b.syslog.type
})
} ]
});
}
if (cfg_b.level && !LOG_LEVEL_OVERRIDE) {
if (bunyan.resolveLevel(cfg_b.level)) {
LOG.level(cfg_b.level);
}
}
}
(function main() {
var _config;
var _options = parseOptions();
LOG.debug({options: _options}, 'command line options parsed');
_config = readConfig(_options);
LOG.debug({config: _config}, 'configuration loaded');
if (_config.logLevel && !LOG_LEVEL_OVERRIDE) {
if (bunyan.resolveLevel(_config.logLevel)) {
LOG.level(_config.logLevel);
}
}
_config.log = LOG;
var snapShotter = new SnapShotter(_config);
snapShotter.on('error', function (err) {
LOG.error('got error from snapshotter', err);
});
snapShotter.start(function () {
LOG.info('snapshotter started');
});
})();
enabled: function(level) {
return config.get('logging').enabled && (bunyan.resolveLevel(level) >= bunyan.resolveLevel(config.get('logging.level')));
},