view src/rep/channel/REPLogger.java @ 193:3133040ee4f4

(no commit message)
author one
date Wed, 31 Dec 2008 15:06:22 +0900
parents
children
line wrap: on
line source

package rep.channel;

public class REPLogger {
	static REPLogger single = new REPLogger();
	
	public static REPLogger singleton(){
//		if(single==null){
//			synchronized(REPLogger.class){
//				if(single==null)
//					single = new REPLogger();
//			}
//		}
		return single;
	}
	protected REPLogger(){
	}

	private int logLevel;
	/** simulation log command */
	public void writeLog(String log, int level){
		if ( level<=logLevel )
			System.out.println(Thread.currentThread().getName()+": "+log);
		//System.out.flush();
	}
	public void writeLog(String log){
		writeLog(log, 0);
	}

	public void setLogLevel(int logLevel) {
		this.logLevel = logLevel;
	}

}