All pastes #424279 Raw Edit

Something

public java v1 · immutable
·published 2007-04-04 17:56 UTC
rendered paste body
package trader.gui;import org.apache.log4j.AppenderSkeleton;import org.apache.log4j.spi.LoggingEvent;import trader.*;public class GuiLogHandler extends AppenderSkeleton{        /** Creates a new instance of SwingLoghandler */    String logMessage=new String("");    GuiLogService logDisplay;    java.text.DateFormat df= java.text.DateFormat.getDateTimeInstance();        	@Override	protected void append(LoggingEvent logEvent) {        // **1 Format the log record and publish it using the GuiLogService object        // **  logDisplay        java.util.Date date = new java.util.Date();        String dateString=df.format(date);        logMessage=dateString+" "+logEvent.getLevel()+" "+logEvent.getMessage()+"\n";        logDisplay.setLog(logMessage);    }        public void setServiceCallback(GuiLogService logDisplay) {    	this.logDisplay = logDisplay;    }        public void flush(){    }    public void close(){        logMessage=null;    }	@Override	public boolean requiresLayout() {		// TODO Auto-generated method stub		return false;	}}