Java Utililty Methods Log Message

List of utility methods to do Log Message

Description

The list of methods to do Log Message are organized into topic(s).

Method

voidlog(String fmt, Object... args)
log
try {
    if (fw == null) {
        fw = new FileWriter("client.log.txt");
    fw.append(String.format("%-4d %s\n", System.currentTimeMillis() % 10000, String.format(fmt, args)));
    fw.flush();
} catch (IOException e) {
    throw new RuntimeException(e);
...
voidlog(String line)
log
try {
    out.write(line);
} catch (Exception e) {
    e.printStackTrace();
voidlog(String message)
log
out.println(message);
voidlog(String message)
log
log(message, System.out);
voidlog(String message, PrintStream out)
log
StackTraceElement se = Thread.currentThread().getStackTrace()[2];
out.println("; " + message + " - [" + se.getClassName() + "." + se.getMethodName() + "(): line "
        + se.getLineNumber() + "]");
voidlog(String msg)
log
writer.println(msg);
writer.flush();
voidLOG(String msg, PrintWriter writer)
LOG
String content = "<script language=\"JavaScript\">" + "console.log('" + msg + "');" + "</script>\n";
writer.append(content);
voidlogLine(String filePath, String line)
log Line
if (filePath == null) {
    String log = (new Date()) + " : " + line + "\n";
    System.out.print(log);
} else {
    try {
        BufferedWriter writer = new BufferedWriter(new FileWriter(filePath, true));
        writer.write(line + "\n");
        writer.flush();
...
voidlogMessage(String message)
log Message
logMessage(Thread.currentThread().hashCode(), message);
voidLogMsg(PrintStream logger, String msg)
Log Msg
if (logger != null) {
    logger.println("Rigor: " + msg);