Java Log to File log(String name, String message)

Here you can find the source of log(String name, String message)

Description

log

License

Open Source License

Declaration

synchronized public static void log(String name, String message) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    private static final SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM 'at' HH:mm:ss");

    synchronized public static void log(String name, String message) {
        String date = dateFormat.format(new Date());
        System.out.println("[" + date + "]\t" + name + ".java\t - " + message);
    }/*from  ww  w .  java 2s.  c om*/
}

Related

  1. log(String message)
  2. log(String message, Exception e)
  3. log(String method, String message)
  4. log(String msg)
  5. log(String msg)
  6. log(String tag, T msg)
  7. logError(ILog log, String message)
  8. logError(String message)
  9. logError(String msg)