-- Internal Utility function to build log messages.   --//
510319
function (logLevel, args) {
            const time = (function (d) {
                const locale = window.navigator.userLanguage || window.navigator.language;
                return d.toLocaleString(locale, { hour12: true }).replace(/([ ]?[aApP][mM])/,
                    '.' + (d.getMilliseconds() + '').padStart(3, '0') + ' $&');
            }(new Date()));
            //-- Each logger can have its own name. If this is  --//
            //-- not provided, it will default to Unknown.      --//
            const loggerName = __private.name || Constants.LOG_UNKNOWN_APP_ID;
            return [('%c[' + logLevel.name + ']').padStart(LOG_PREFIX_WIDTH), getLogLabel(logLevel), time, '-',
                loggerName.padEnd(Constants.LOG_APP_ID_WIDTH), ':'].concat(Object.values(args));
        }
294764
function log(...args) {
		console.log('#output +=', ...args);
		output.textContent += args.map(a => typeof a === 'string' ? a : JSON.stringify(a)).join(' ') +'\n';
	}
1051287
function buildMessageClass(msgSpec) {

  function Message(values) {
    if (!(this instanceof Message)) {
      return new Message(values);
    }

    var that = this;

    if (msgSpec.fields) {
      msgSpec.fields.forEach(function(field) {
        if (!field.isBuiltin) {
          // sub-message class
          // is it an array?
          if (values && typeof values[field.name] != "undefined") {
            // values provided
            if (field.isArray) {
              that[field.name] = values[field.name].map(function(value) {
                  return new (getMessageFromRegistry(field.baseType, 'msg'))(value);
                });
            } else {
              that[field.name] =
                new (getMessageFromRegistry(field.baseType, 'msg'))(values[field.name]);
            }
          } else {
            // use defaults
            if (field.isArray) {
              // it's an array
              const length = field.arrayLen || 0;
              that[field.name] = new Array(length).fill(new (getMessageFromRegistry(field.baseType, 'msg'))());
            } else {
              that[field.name] = new (getMessageFromRegistry(field.baseType, 'msg'))();
            }
          }
        } else {
          // simple type
          that[field.name] =
            (values && typeof values[field.name] != "undefined") ?
             values[field.name] :
             (field.value || fieldsUtil.getDefaultValue(field.type));
        }
      });
    }
  };

  Message.messageType = msgSpec.getFullMessageName();
  // TODO: bring these back?
  // Message.packageName = details.packageName;
  // Message.messageName = Message.prototype.messageName = details.messageName;
  // Message.md5         = Message.prototype.md5         = details.md5;
  const md5Sum = msgSpec.getMd5sum();
  Message.md5sum = function() {
    return md5Sum;
  };
  Message.Constants = (() => {
      const ret = {};
      msgSpec.constants.forEach((constant) => {
        ret[constant.name.toUpperCase()] = constant.value;
      });
    return ret;
  })();
  Message.fields = msgSpec.fields;
  Message.serialize = function(obj, buffer, offset) {
      serializeInnerMessage(msgSpec, obj, buffer, offset);
    };
  Message.deserialize = function(buffer) {
    var message = new Message();

    message = deserializeInnerMessage(msgSpec, message, buffer, [0]);

    return message;
  };
  Message.getMessageSize = function(msg) { return fieldsUtil.getMessageSize(msg, msgSpec); };

  const fullMsgDefinition = msgSpec.computeFullText();
  Message.messageDefinition = function() { return fullMsgDefinition; };
  Message.datatype = function() { return msgSpec.getFullMessageName(); };

  return Message;
}
1264442
function loggerFactory(
    events,
    Constants,
    assert,
    _,
    util,
    stack,
    nconf
) {
    var levels = _.keys(Constants.Logging.Levels);

    function getCaller (depth) {
        var current = stack.get()[depth];

        var file = current.getFileName().replace(
            Constants.WorkingDirectory,
            ''
        ) + ':' + current.getLineNumber();

        return file.replace(/^node_modules/, '');
    }

    function Logger (module) {
        var provides = util.provides(module);

        if (provides !== undefined) {
            this.module = provides;
        } else {
            if (_.isFunction(module)) {
                this.module = module.name;
            } else {
                this.module = module || 'No Module';
            }
        }
    }

    Logger.prototype.log = function (level, message, context) {
        assert.isIn(level, levels);
        assert.string(message, 'message');

        // Exit if the log level of this message is less than the minimum log level.
        var minLogLevel = nconf.get('minLogLevel');
        if ((minLogLevel === undefined) || (typeof minLogLevel !== 'number')) {
            minLogLevel = 0;
        }
        if (Constants.Logging.Levels[level] < minLogLevel) {
            return;
        }

        events.log({
            name: Constants.Name,
            host: Constants.Host,
            module: this.module,
            level: level,
            message: message,
            context: context,
            timestamp: new Date().toISOString(),
            caller: getCaller(3),
            subject: 'Server'
        });
    };

    _.forEach(levels, function(level) {
        Logger.prototype[level] = function (message, context) {
            this.log(level, message, context);
        };
    });

    Logger.prototype.deprecate = function (message, frames) {
        console.error([
            'DEPRECATION:',
            this.module,
            '-',
            message,
            getCaller(frames || 2)
        ].join(' '));
    };

    Logger.initialize = function (module) {
        return new Logger(module);
    };

    return Logger;
}
689507
function _format_log($message_log, $message_number_log)
    {
        $output = '';
        for ($i = 0; $i < count($message_log); $i++) {
            $output.= $message_number_log[$i] . "\r\n";
            $current_log = $message_log[$i];
            $j = 0;
            do {
                if (strlen($current_log)) {
                    $output.= str_pad(dechex($j), 7, '0', STR_PAD_LEFT) . '0  ';
                }
                $fragment = $this->_string_shift($current_log, $this->log_short_width);
                $hex = substr(preg_replace_callback('#.#s', array($this, '_format_log_helper'), $fragment), strlen($this->log_boundary));
                // replace non ASCII printable characters with dots
                // http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters
                // also replace < with a . since < messes up the output on web browsers
                $raw = preg_replace('#[^\x20-\x7E]|<#', '.', $fragment);
                $output.= str_pad($hex, $this->log_long_width - $this->log_short_width, ' ') . $raw . "\r\n";
                $j++;
            } while (strlen($current_log));
            $output.= "\r\n";
        }

        return $output;
    }
545268
function evaluateLogRowArgs(logArgs) {
  var name = logArgs[0];
  var logLevel = logArgs[1];
  var message = null;
  var obj = null;

  var firstArg = logArgs[2];

  if (!firstArg) {
    throw new Error('Invalid logArgs. At least one argument to log must be given.');
  }

  // resolve first argument if it is message or metadata
  if (_.isString(firstArg)) {
    message = util.format.apply(util.format, _.slice(logArgs, 2, logArgs.length));
  } else if (_.isFunction(firstArg)) {
    var firstArgFunctionResult = firstArg();
    if (_.isString(firstArgFunctionResult)) {
      message = firstArgFunctionResult;
    } else {
      obj = firstArgFunctionResult;
    }
  } else {
    obj = firstArg;
  }

  // if first argument was object, second argument defines the message
  // and if second argument is function it evaluates to message or params
  // are passed to util.format
  var secondArg = logArgs[3];

  if (!message && secondArg) {
    if (_.isFunction(secondArg)) {
      message = secondArg();
    } else {
      message = util.format.apply(util.format, _.slice(logArgs, 3, logArgs.length));
    }
  }

  return {
    name: name,
    level: logLevel,
    metadata: obj,
    message: message
  };
}
552781
function log(obj, message) {
		obj = obj || [];
		obj.push({
			time: new Date(),
			log: message
		});
		
		return obj;
	}
1090515
function(message, level) {
            level = level || Base.LOGLEVEL.INFO;

            if (message instanceof Error) {
                message = message.toString() + (message.stack || "");
            }

            if (Base.logger.length) {
                for (var i = 0; i < Base.logger.length; i++) {
                    Base.logger[i].log(message, level);
                }
            } else if (typeof console !== "undefined") {
                var method = (console[level] || console.log);
                if(method){
                    try {
                        method.call(console, "[ " + (new Date()) + " ]: ", message);
                    } catch (e) {
                        // nothing to do here
                    }
                }
            }
        }
477339
function (fn, module, data, verbose) {

        let complete = module.toUpperCase() + " > ";

            // Only provide verbose log if logLevel > 5
            verbose = config.logLevel >= 5 ? (verbose || undefined) : undefined;

        // When writing to console
        if ( config.destination === console) {

            // Compose message
            complete = " [ " + new Date().toLocaleString() + " ] " + complete + data;

            if ( fn == "error" ) 
                complete = complete.bgRed.white;
            else if ( fn == "warning" )
                complete = complete.bgYellow.black

        // ... when writing to a custom log function
        } else {
            complete += fn + ': ' + data;

        }

        // Check that destination.fn exists, fallback to destination.log
        let logger = (config.destination[fn] || config.destination.log).bind(config.destination);

        if ( verbose !== undefined ) {
            logger(complete, verbose);    
        } else {
            logger(complete);
        }
        
        
    }
343592
function logger(type) {
    var args = [];
    for (var _i = 1; _i < arguments.length; _i++) {
        args[_i - 1] = arguments[_i];
    }
    var msg = args.shift();
    var fn = chek_1.isFunction(chek_1.last(args)) ? args.pop() : chek_1.noop;
    var meta = chek_1.isPlainObject(chek_1.last(args)) ? args.pop() : null;
    var obj = {
        type: type,
        msg: null,
        meta: meta
    };
    var formatters = chek_1.isString(msg) ? msg.match(/%/g) : null;
    if (formatters && formatters.length)
        msg = util_1.format.apply(void 0, [msg].concat(args));
    else
        msg = [msg].concat(args).join(' ');
    if (type === 'error' && !(msg instanceof Error)) {
        msg = new Error(msg);
        var stack = msg.stack.split('\n');
        var tmpMsg = stack.shift();
        stack.shift();
        stack.unshift(tmpMsg);
        msg.stack = stack.join('\n');
    }
    // If any error just throw it.
    if (msg instanceof Error) {
        if (fn)
            fn(msg, obj);
        msg.stack = msg.stack.split('\n').map(function (s, i) {
            if (i === 0)
                return colurs.applyAnsi('[error]', _log.colors.error) + ' ' + (msg.name || 'Error') + ': ' + msg.message;
            return s;
        }).join('\n');
        throw msg;
    }
    obj.msg = msg;
    fn(msg, obj);
    if (meta) {
        meta = util_1.inspect(meta, null, null, true);
        msg += ('\n' + meta);
    }
    if (type && _log.colors[type])
        msg = colurs.applyAnsi('[' + type + ']: ', _log.colors[type]) + msg;
    process.stderr.write(msg + '\n');
    return _log;
}
772367
function Logger (context) {
    var loggerObj, i;

    if (!context || context.length === 0) {
        throw new Error("Invalid 'context' for Logger: " + context);
    }

    loggerObj = {
        debug   : function(scope, message) {
            console.debug(context + separator +
                scope +
                (message && message.length > 0 ? separator + message : "")
            );
        },
        info    : function(scope, message) {
            console.info(context + separator +
                scope +
                (message && message.length > 0 ? separator + message : "")
            );
        },
        warn    : function(scope, message) {
            console.warn(context + separator +
                scope +
                (message && message.length > 0 ? separator + message : "")
            );
        },
        error   : function(scope, message) {
            console.error(context + separator +
                scope +
                (message && message.length > 0 ? separator + message : "")
            );
        }
    };


    return loggerObj;
}
284604
private String buildLogPath(File bootstrapLogDir, String logFileName) {
    return new File(bootstrapLogDir, logFileName).getAbsolutePath();
  }
368998
function log(text) {
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'success';
  var debug$$1 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;

  if (!debug$$1) {
    return;
  }

  var success = 'padding: 2px; background: #219621; color: #ffffff';
  var warning = 'padding: 2px; background: #f1e05a; color: #333333';
  var error = 'padding: 2px; background: #b9090b; color: #ffffff';
  var types = { error: error, success: success, warning: warning };

  console.log('%c [Storage Helper] ' + text + ' ', types[type]);
}
566559
function log(message) {
  if (message instanceof Error) {
    console.log(message.stack);
  }

  if (CONFIG.debug) {
    if (typeof message === "object") {
      console.log(JSON.stringify(message, null, 2));
    } else {
      console.log(message);
    }
  }
}
114200
function( message, caller, callback)
    //
    {
        var calledBy = '', logMessage;

        if ( stringUtil.stringIsEmpty(message) ) { return; }

        if ( caller ) {
            calledBy = ' <'+caller+'> ';
        }

        logMessage = dateUtil.nowToString() + calledBy + ': ' +  message + '\n';

        this.stream.write(logMessage, 'utf8', callback);
    }
699832
function log( func, msg ){
  var logline = '['+func+'] '+msg;

  if ( logInfo ) {
    if ( logInfoStr == '' ) {
      console.log( logline );      
    } else if ( logInfoStr.indexOf( func ) >= 0 ) { 
      console.log( logline );
    }
  }

  // send log to event broker
  if ( loggerEvents ) { 
    var logBroker = getEventBroker('log');
    logBroker.cleanupQueue( 1000 );
    logBroker.queueEvent( { text: logline, channel:'log' } );
  }
  
}
769792
function Logger_createReadLogServer() {
            var that = this;
            this.server = new HttpServer();
            this.server.on('request', function (request, response) {
                var startMessage = 'LAST '+ that.config.readLength + ' BYTES:\n\n';

                fs.open(that.file, 'r', 755, function(status, fd) {
                    fs.fstat(fd, function (err, stats) {
                        var size = stats.size,
                            start = size > that.config.readLength ? size - that.config.readLength : 0,
                            end = size > that.config.readLength ? that.config.readLength : size,
                            buffer =  new Buffer(end + startMessage.length);
                        buffer.fill(startMessage);
                        fs.read(fd, buffer, startMessage.length, end, start, function() {
                            response.writeHead(200, {'Content-type': 'text/plain', 'Content-Length': buffer.length});
                            response.end(buffer);
                        });
                    });
                });

            });

            this.server.listen(this.config.port);

            this.info('Publishing log write stream on port: ', this.config.port);
        }