Logger
: Formats and logs message.

@param type the type of message to log.
@param args rest param of log arguments.
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;
}
1304954
@SuppressWarnings("regexpsinglelinejava")
    private static void print(final String message, final Object... args) {
        if (DEBUG) {
            final String logMessage;
            if (args.length == 0) {
                logMessage = message;
            } else {
                for (int i = 0; i < args.length; ++i) {
                    // arguments may be null
                    if (args[i] == null) {
                        continue;
                    }
                    if (args[i].getClass().isArray()) {
                        // cast back to array! Note that primitive arrays are not supported
                        args[i] = Arrays.toString((Object[])args[i]);
                    } else if (args[i] == Class.class) {
                        args[i] = ((Class<?>)args[i]).getName();
                    }
                }
                logMessage = String.format(message, args);
            }
            System.out.println(logMessage);
        }
    }
1043299
public static void error(final Logger logger, final String format, final Object... params) {
		error(logger, format, null, params);
	}
984104
public void info(String format, Object arg) {
        if (logger.isInfoEnabled()) {
            FormattingTuple ft = MessageFormatter.format(format, arg);
            logger.log(FQCN, Level.INFO, ft.getMessage(), ft.getThrowable());
        }
    }
872521
public static String format (Object message, Object... args)
    {
        return new LogBuilder(message, args).toString();
    }
515473
public void log(int logLevel, String format, Object... args) {
    println(logLevel, format, args);
  }
86641
private void printf( String pattern, Object... args )
    {
        if( m_log != null )
        {
            StringBuilder sb = new StringBuilder();
            Formatter formatter = new Formatter(sb);

            try
            {
                formatter.format(pattern, args);

                m_log.info(sb.toString());
            }
            finally
            {
                formatter.close();
            }
        }
    }
1080094
public static void warning(Logger log, String format, Object... args) {
        if (log.isLoggable(Level.WARNING))
            log.warning(String.format(format, args));
    }
1194239
public static boolean log(Level level, Throwable t, String format, Object... arguments) {
		return log(LogFactory.get(CallerUtil.getCallerCaller()), level, t, format, arguments);
	}
454476
def _write_log(self, log_type, log_time, message):
        
        timestamp = datetime.datetime.now().strftime(" %Y-%m-%d %H:%M:%S")
        log_entry = "[{}{}] {}".format(log_type, timestamp if log_time else "", message)
        if self._logger and callable(getattr(self._logger, self._logger_methods[log_type], None)):
            # Check for log handler (sends message only if _logger_no_prefix is True)
            getattr(
                self._logger,
                self._logger_methods[log_type],
                None
                )(message if self._logger_no_prefix else log_entry)
        elif self._log_file:
            # Otherwise write to file, if a file has been specified
            with open(self._log_file, 'a') as logfile:
                try:
                    logfile.write(unicode(log_entry + "\n"))
                except NameError: # `unicode` only works in Python 2
                    logfile.write(log_entry + "\n")
        else:
            # Otherwise, print to STDOUT
            print(log_entry)
1202986
function (baseType, args) {
        jv._logError(jv.INVALID_TYPE_VALUE, [baseType.typeName, args.beanDef[jv._MD_TYPENAME], args.value, args.path]);
    }
812818
public static void i(String tag, String msg, Object... args) {
        if (sLevel > LEVEL_INFO) {
            return;
        }
        if (args.length > 0) {
            msg = String.format(msg, args);
        }
        Log.i(tag, msg);
    }
602334
public static void v(String tag, String msg, Object... args) {
        if (sLevel > LEVEL_VERBOSE) {
            return;
        }
        if (args.length > 0) {
            msg = String.format(msg, args);
        }
        Log.v(tag, msg);
    }
437010
function log(type, args, color){
  pad();
  var msg = format.apply(format, args);
  if (color) msg = chalk[color](msg);
  var pre = prefix();
  console[type](pre, msg);
}
1226554
public static void warnWithException(Logger logger, String format, Object... arguments) {
    if (logger.isDebugEnabled()) {
      logger.warn(format, arguments);
    } else {
      Object last = arguments[arguments.length - 1];
      if (last instanceof Throwable) {
        Throwable t = (Throwable) last;
        arguments[arguments.length - 1] = t.getClass().getSimpleName() + ": " + t.getMessage();
        logger.warn(format + " ({})", arguments);
      } else {
        // Should only be called with an exception as last argument, but handle gracefully anyway
        logger.warn(format, arguments);
      }
    }
  }
808569
function _log(type, message){
		var _debugger = $('div.lcars-debug pre');
		if( type == 'log' ){
			var message = '<span style="background:transparent;color:black">'+message+'</span>';
			_debugger.append(message+'<br>');
		}
		else if( type == 'warning' ){
			var message = '<span style="background:orange;color:black;">'+message+'</span>';
			_debugger.append(message+'<br>');
		}
		else if( type == 'error' ){
			var message = '<span style="background:#f00;color:white;font-weight:bold;">'+message+'</span>';
			_debugger.append(message+'<br>');
		}
		else if( type == 'info' ){
			var message = '<span style="background:#99f;color:white;">'+message+'</span>';
			_debugger.append(message+'<br>');
		}
		else{
			_debugger.append('<span style="background:#f00;color:white;font-weight:bold;">Unknown!</span><br>');
		}
}
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)
  }
}