构造日志函数

@param {string} type 日志类型
@returns {function} log function
170493
function log (type) {
  return (...message) => {
    if (!message.length) {
      return
    }

    const { colorFn, icon } = getColorFnAndIconByType(type)
    const output = ['']

    message.forEach((item, index) => {
      if (index === 0) {
        output.push(`  ${icon} ${item}`)
        return
      }

      output.push(`    ${item}`)
    })

    output.push('')

    console.log(colorFn(output.join('\n')))
  }
}
705569
function log(level, message) {
  if(!~map[this._level].indexOf(level)) return false;
  var pid = process.pid
    , time = logtime()
    , args = slice.call(arguments, 1)
    , cb = typeof args[args.length - 1] === 'function'
      ? args.pop() : null
    , stream = level === LEVELS.WARNING ? this._err : this._out;
  var msg = '[' + pid + '] ' + time + ' '
    + getPrefix(level, stream.isTTY) + ' ';

  if(args.length > 1) {
    message = util.format.apply(util, args);
  }else{
    message = args[0];
  }
  msg += message + EOL;
  stream.write(msg, cb);
  return message;
}
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));
        }
911526
function log(data) {
  if (type.isError(data)) {
    if (!data.handled) {
      _setHandled(data);
      _console.error(data);
    }
  }
  else {
    _console.log(_transform(data));
  }
  return data;
}
793592
function log(msg) {
  var d = new Date(), ts;
  ts = d.toLocaleTimeString().split(' ');
  ts = ts[0] + '.' + d.getMilliseconds() + ' ' + ts[1];
  
  console.log('[' + ts + '] ' + msg);
}
693403
function log (state, type, namespace, message) {
  const level = levels[ type ]
  _.each(state.loggers, function (logger) {
    logger.log({
      type: type,
      level: level,
      namespace: namespace,
      message: message
    })
  })
}
1258419
function (classpath, msg) {
            this._logs[this._nbLogs++] = {
                classpath : classpath,
                msg : msg,
                timestamp : (new Date()).getTime()
            };
        }
920973
function log($message, $type = null, $explicit = false) {
		try {
			$time = date('Y-m-d|H:i:s');
			if ($type === null) {
				$this->appendToFile(date('Y/m/d'), "[$time] $message", $explicit);
			}
			else { // type !== null
				$this->appendToFile($type, "[$time] $message", $explicit);
			}
		}
		catch (\Exception $e) {
			$this->failedLogging($e, $message);
		}
	}
130445
function log(isError, message, data){
    if(self.verbose || isError){
      if(data) console.log(self.type + ': ' + message, data);
      else console.log(self.type + message);
    }
  }
137305
function(type) {
            var name = type;
            this[type] = _.bind(function() {
                var args = Array.prototype.slice.call(arguments, 0);
                args.splice(0, 0, type);
                return this.printLog.apply(this, args);
            }, this);
            return this[type];
        }
529352
function log(logger, message, type) {
  if(!logger) return
  if(logger.toConsole) {
    if (console.group) console.group('i18n-tag-schema')
    const log = console[type] || console.log
    log(message)
    if (console.groupEnd) console.groupEnd()
  } else {
    const log = logger[type]
    if(log) log(message)
  }
}
134693
function log(type, ...rest) {
	if (argv.output) {
		console.log(LOG[type](rest));
	}
}
882037
function(logRecord, opt_type) {
      return new Entry(
          normalizeLevel(/** @type {!Logger.Level} */(logRecord.getLevel())),
          '[' + logRecord.getLoggerName() + '] ' + logRecord.getMessage(),
          logRecord.getMillis(),
          opt_type);
    }
402861
function writeLog(type, category){
    return function(messages) {
        var funcs = [];

        _.each(messages, function(message){
            funcs.push(this.client.logAsync(message, [type, category]));
        }.bind(this));

        return BB.all(funcs);
    };

}
538740
function log(type, label, data) {
	var typeLabel = type.charAt(0).toUpperCase() + type.slice(1);
	var color;

	if (typeLabel === 'Error') {
		typeLabel = chalk.red(typeLabel);
		color = 'red';
	} else if (typeLabel === 'Warn') {
		typeLabel = chalk.yellow(typeLabel);
		color = 'yellow';
	} else if (typeLabel === 'Info') {
		typeLabel = chalk.green(typeLabel);
		color = 'green';
	} else if (typeLabel === 'Log') {
		typeLabel = chalk.gray(typeLabel);
		color = 'gray';
	}

	// used to avoid logging "undefined" in the console
	if (useTypeLabels) {
		label = typeLabel + ': ' + chalk.cyan(label);
	} else {
		label = chalk[color](label);
	}
	if (data) {
		console[type](label, data);
	} else {
		console[type](label);
	}
}
661533
function Event(type) {
    var me = this;
    return (me == null || me.constructor != Event)
      ? new Event(type)
      : (type instanceof Event)
          ? type
          : extend(me, { 'timeStamp': +new Date }, typeof type == 'string' ? { 'type': type } : type);
  }
839812
function log(type, msg, code) {
  code = code || 0;
  if ((exports.level & code) > 0) {
    var listener = exports.on[type];
    if (listener) {
      listener(msg);
    }
    exports.on.any(type, msg);
  }
}