37 |
public abstract class Logger |
public abstract class Logger |
38 |
{ |
{ |
39 |
|
|
40 |
/** |
/** |
41 |
* The singleton instance of this class. |
* The singleton instance of this class. |
42 |
*/ |
*/ |
43 |
private static Logger instance = new StderrLogger(); |
private static Logger instance = new StderrLogger(); |
44 |
|
|
45 |
/** |
/** |
46 |
* Returns the singleton instance of this class. |
* Returns the singleton instance of this class. |
47 |
*/ |
*/ |
48 |
public static Logger getInstance() |
public static Logger getInstance() |
49 |
{ |
{ |
50 |
return instance; |
return instance; |
51 |
} |
} |
52 |
|
|
53 |
/** |
/** |
54 |
* Sets the singleton instance of this class. |
* Sets the singleton instance of this class. |
55 |
* @param logger the new logger to use |
* @param logger the new logger to use |
56 |
*/ |
*/ |
57 |
public static void setInstance(Logger logger) |
public static void setInstance(Logger logger) |
58 |
{ |
{ |
59 |
if (logger==null) |
if (logger == null) |
60 |
throw new NullPointerException(); |
throw new NullPointerException(); |
61 |
instance = logger; |
instance = logger; |
62 |
} |
} |
63 |
|
|
64 |
/** |
/** |
65 |
* Logs a configuration message. |
* Logs a configuration message. |
66 |
* This is used by the inetlib implementation itself. |
* This is used by the inetlib implementation itself. |
67 |
* @param message the message |
* @param message the message |
68 |
*/ |
*/ |
69 |
public abstract void config(String message); |
public abstract void config(String message); |
70 |
|
|
71 |
/** |
/** |
72 |
* Logs a provider-specific debugging message. |
* Logs a provider-specific debugging message. |
73 |
* @param protocol the provider protocol |
* @param protocol the provider protocol |
74 |
* @param message the message |
* @param message the message |
75 |
*/ |
*/ |
76 |
public abstract void log(String protocol, String message); |
public abstract void log(String protocol, String message); |
77 |
|
|
78 |
} |
} |