Code example for LogRecord

Methods: getLevelgetLoggerNamegetMessagegetParameters

0
			return Log.Level.INFO; 
		} 
	} 
 
	private static void redirectToLogger(LogRecord record) {
		String loggerName = record.getLoggerName();
		int idx = loggerName.lastIndexOf('.');
		if (idx > 0) {
			loggerName = loggerName.substring(idx + 1);
		} 
		Log logger = Log.get(loggerName);
		logger.log(toLevel(record.getLevel()), getMessage(record));
	} 
 
	public static String getMessage(LogRecord record) {
		String msg = record.getMessage();
		Object[] parameters = record.getParameters();
		if (parameters != null && parameters.length > 0) {
			msg = MessageFormat.format(msg, parameters);
		} 
		return msg;
	} 
Experience pair programming with AI  Get Codota for Java