KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mortbay > log > LogSink


1 // ========================================================================
2
// Copyright (c) 1997 MortBay Consulting, Sydney
3
// $Id: LogSink.java,v 1.1 2004/06/04 21:37:20 gregwilkins Exp $
4
// ========================================================================
5

6 package org.mortbay.log;
7
8 import java.io.Serializable JavaDoc;
9
10 import org.mortbay.util.LifeCycle;
11
12 /* ------------------------------------------------------------ */
13 /** A Log sink.
14  * This class represents both a concrete or abstract sink of
15  * Log data. The default implementation logs to a PrintWriter, but
16  * derived implementations may log to files, syslog, or other
17  * logging APIs.
18  *
19  *
20  * @version $Id: LogSink.java,v 1.1 2004/06/04 21:37:20 gregwilkins Exp $
21  * @author Greg Wilkins (gregw)
22  */

23 public interface LogSink extends LifeCycle, Serializable JavaDoc
24 {
25     /* ------------------------------------------------------------ */
26     public void setLogImpl(LogImpl impl);
27    
28     /* ------------------------------------------------------------ */
29     /** Log a message.
30      * This method formats the log information as a string and calls
31      * log(String). It should only be specialized by a derived
32      * implementation if the format of the logged messages is to be changed.
33      *
34      * @param tag Tag for type of log
35      * @param msg The message
36      * @param frame The frame that generated the message.
37      * @param time The time stamp of the message.
38      */

39     public void log(String JavaDoc tag,
40                     Object JavaDoc msg,
41                     Frame frame,
42                     long time);
43     
44     /* ------------------------------------------------------------ */
45     /** Log a message.
46      * The formatted log string is written to the log sink. The default
47      * implementation writes the message to a PrintWriter.
48      * @param formattedLog
49      */

50     public void log(String JavaDoc formattedLog);
51
52 };
53
54
55
56
57
58
59
60
61
Popular Tags