Mercurial > hg > RemoteEditor > REPSessionManager
view rep/channel/REPLogger.java @ 471:d2762d669617
sleep command to wait for singleton prevention
author | one |
---|---|
date | Tue, 12 Oct 2010 10:19:59 +0900 |
parents | edb373aa421e |
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=3; /** 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, 2); } public void setLogLevel(int logLevel) { this.logLevel = logLevel; } public int logLevel() { return logLevel; } }