view test/editortest/Logger.java @ 479:4bca0a64cdb9

close this one.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 15 Oct 2010 19:42:22 +0900
parents b7f42fc75a36
children
line wrap: on
line source

package test.editortest;

public class Logger {

	public static void print(Object obj){
		StackTraceElement e = new Exception().getStackTrace()[1];
		System.out.println(e.getClassName() + "." + e.getMethodName() + "() : " + obj.toString());
	}

	public static void print() {
		StackTraceElement e = new Exception().getStackTrace()[1];
		System.out.println(e.getClassName() + "." + e.getMethodName() + "()");
	}
	
	
	public static void printT(Object obj){
		System.out.println(Thread.currentThread().toString() + " : " + obj);
	}
	
	
	public static void print(LogTarget target, Object obj){
		StackTraceElement e = new Exception().getStackTrace()[1];
		String msg = e.getClassName() + "." + e.getMethodName() + "() : " + obj.toString();
		if(target != null){
			target.printLog(msg);
		}
	}
}