Here you can find the source of logError(String msg)
public synchronized static void logError(String msg)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public synchronized static void logError(String msg) { System.err.println(getDateTime("yyyy-MM-dd HH:mm:ss") + ": " + msg); }/*w w w. j ava2 s .c o m*/ /** * Formats and returns a string containing the current date & time * @return current data + time */ public static String getDateTime(String format) { SimpleDateFormat dateFormat = new SimpleDateFormat(format); Date date = new Date(); return dateFormat.format(date); } }