Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
};
//
// Load supported appenders
//
log4js.loadAppender('file');
log4js.loadAppender('console');
log4js.loadAppender('clustered');
log4js.loadAppender('logLevelFilter');
//
// clear default loggers
//
log4js.clearAppenders();
function clusteredAppender(children, category) {
let clusterAppenderConfig = {
appenders: [], // configs
actualAppenders: [] // functions
};
children.forEach(appender => {
clusterAppenderConfig.appenders.push({ category });
clusterAppenderConfig.actualAppenders.push(appender);
});
return log4js.appenders.clustered(clusterAppenderConfig);
}
//
if (threshold) {
level = log4js.levels.toLevel(threshold, baseLevel);
// get upper threshold
level = level.isGreaterThanOrEqualTo(baseLevel) ? level : baseLevel;
}
// return thresholded appender
return log4js.appenders.logLevelFilter(level, appender);
}
//
// clear default loggers
//
log4js.clearAppenders();
//
// configure console logger for non-production environment only
//
if ('production' !== N.runtime.env) {
log4js.addAppender(log4js.appenders.console());
}
//
// leave only loggers (with appenders) configs, removing keywords
//
delete config.options;
//
function Cimpler(config) {
if (config && config.testMode) {
log4js.clearAppenders();
}
var builds = new NotifyQueue();
var cimpler = this;
var connect;
var connectServer;
var running = true;
var consumers = [];
this.plugins = [];
config = config || {};
this.addBuild = function(build) {
build.status = build.status || 'pending';
// The _control property allows plugins to pass around data
function initLogger(options) {
var customLoggingAppender = options['customServiceLogger'];
if ( customLoggingAppender ) {
// clear the default appender(s)
log4js.clearAppenders();
//
log4js.addAppender(customLoggingAppender, 'jive-sdk');
}
var logfile = options['logFile'] || options['logfile'];
var logLevel = process.env['jive_logging_level'] || options['logLevel'] || options['loglevel'] || 'INFO';
logLevel = logLevel.toUpperCase();
if (logfile) {
if (logfile.indexOf('logs/') === 0) {
if (!fs.existsSync('logs')) {
jive.logger.warn('logs subdirectory does not exist. Creating directory now.');
fs.mkdirSync('logs');
}
}