log(level, message, data) {
    var args = Array.prototype.slice.call(arguments);

    if (Logger.LEVELS.indexOf(args[0]) == -1) {
      level = 'info';
    } else {
      level = args.shift();
    }

    if (this.levelIndex > Logger.LEVELS.indexOf(level))
      return;

    message = typeof args[0] === 'string'? this._format(args.shift(), args): '[no message]';
    data = null;
    if (args.length && typeof args[args.length - 1] === 'object') {
      data = args.pop();
      if (Array.isArray(data))
        data = {data: data};
    }

    if (args.length) {
      message += ", " + args.join(", ");
    }

    return this._log({
      date: new Date(),
      message: message,
      level: level,
      user: this.entityManager.me && this.entityManager.me.id,
      data: data
    });
  }
/**
   * Logs a message with the given log level
   * @param {string} level The level used to log the message
   * @param {string} message The message to log, the message string can be interpolated like the node util.format method
   * @param {Object<string, *>} [data=null] An optional object which will be included in the log entry
   *
   * @see https://nodejs.org/api/util.html#util_util_format_format
   */
Logs a message with the given log level
@param {string} level The level used to log the message
@param {string} message The message to log, the message string can be interpolated like the node util.format method
@param {Object} [data=null] An optional object which will be included in the log entry


Logs a message with the given log level @param { string } level The level used to log the message @param { string } message The message to log the message string can be interpolated like the node util . format method @param { Object } [ data = null ] An optional object which will be included in the log entry
log(level, message, data) {
    var args = Array.prototype.slice.call(arguments);
    if (Logger.LEVELS.indexOf(args[0]) == -1) {
      level = 'info';
    } else {
      level = args.shift();
    }
    if (this.levelIndex > Logger.LEVELS.indexOf(level))
      return;
    message = typeof args[0] === 'string'? this._format(args.shift(), args): '[no message]';
    data = null;
    if (args.length && typeof args[args.length - 1] === 'object') {
      data = args.pop();
      if (Array.isArray(data))
        data = {data: data};
    }
    if (args.length) {
      message += ", " + args.join(", ");
    }
    return this._log({
      date: new Date(),
      message: message,
      level: level,
      user: this.entityManager.me && this.entityManager.me.id,
      data: data
    });
  }
log ( level , message , data ) { var args = Array . prototype . slice . call ( arguments ) ; if ( Logger . LEVELS . indexOf ( args [ 0 ] ) == - 1 ) { level = 'info' ; } else { level = args . shift ( ) ; } if ( this . levelIndex > Logger . LEVELS . indexOf ( level ) ) return ; message = typeof args [ 0 ] === 'string' ? this . _format ( args . shift ( ) , args ) : '[no message]' ; data = null ; if ( args . length && typeof args [ args . length - 1 ] === 'object' ) { data = args . pop ( ) ; if ( Array . isArray ( data ) ) data = { data : data } ; } if ( args . length ) { message += ", " + args . join ( ", " ) ; } return this . _log ( { date : new Date ( ) , message : message , level : level , user : this . entityManager . me && this . entityManager . me . id , data : data } ) ; }
Logs a message with the given log level
 @param {string} level The level used to log the message
 @param {string} message The message to log, the message string can be interpolated like the node util.format method
 @param {Object<string, *>} [data=null] An optional object which will be included in the log entry
Logs a message with the given log level @param { string } level The level used to log the message @param { string } message The message to log the message string can be interpolated like the node util . format method @param { Object<string * > } [ data = null ] An optional object which will be included in the log entry