Here you can find the source of log(String format, Object... arguments)
Parameter | Description |
---|---|
format | Message, formatted per SLF4J requirements |
arguments | Arguments to substitute into the message before logging |
public static void log(String format, Object... arguments)
//package com.java2s; //License from project: Apache License import org.slf4j.Logger; import org.slf4j.helpers.MessageFormatter; public class Main { private static Logger logger; /**/*w ww . ja v a 2 s .c om*/ * Log a message. If a logger has been specified, log the message at INFO level. Otherwise the message is logged * to System.out. * @param format Message, formatted per SLF4J requirements * @param arguments Arguments to substitute into the message before logging */ public static void log(String format, Object... arguments) { if (null != logger) { logger.info(format, arguments); } else { System.out.println(MessageFormatter.arrayFormat(format, arguments).getMessage()); } } }