Here you can find the source of log(String format, Object... args)
public static void log(String format, Object... args)
//package com.java2s; //License from project: Open Source License import java.util.Date; import java.text.SimpleDateFormat; public class Main { public static void log(String format, Object... args) { StackTraceElement[] stack = Thread.currentThread().getStackTrace(); StackTraceElement callee = stack[2]; String calleeClassname = callee.getClassName(); String timestamp = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss") .format(new Date()); System.err.printf(//from w w w . java 2s.c o m timestamp + " " + calleeClassname + ": " + format, args); } }