01: package net.matuschek.jobo;
02:
03: /*********************************************
04: Copyright (c) 2001 by Daniel Matuschek
05: *********************************************/
06:
07: import org.apache.log4j.AppenderSkeleton;
08: import org.apache.log4j.spi.LoggingEvent;
09:
10: /**
11: *
12: * Simple object that is used to connect the JoBo LogFrame with
13: * Log4J. It simply implements a Log4J Appender
14: *
15: * @author Daniel Matuschek
16: * @version $Id $
17: */
18:
19: public class LogFrameAppender extends AppenderSkeleton {
20: private LogFrame log;
21:
22: public LogFrameAppender(LogFrame log) {
23: super ();
24: this .log = log;
25: }
26:
27: public void append(LoggingEvent e) {
28: log.addMsg(e.getMessage().toString());
29: }
30:
31: public void close() {
32: log.setVisible(false);
33: }
34:
35: public boolean requiresLayout() {
36: return false;
37: }
38:
39: } // LogFrameAppender
|