2 |
|
package uk.ac.ukc.iscream.core; |
3 |
|
|
4 |
|
//---IMPORTS--- |
5 |
< |
import org.omg.CORBA.*; |
6 |
< |
import org.omg.PortableServer.*; |
5 |
> |
import uk.ac.ukc.iscream.util.*; |
6 |
|
|
7 |
|
/** |
8 |
|
* The ScreenLoggerServant is an implementation of the Logger defined |
33 |
|
public LoggerServant(LoggerImpl logger) { |
34 |
|
_logger = logger; |
35 |
|
_verbosityLevel = Integer.parseInt(System.getProperty("uk.ac.ukc.iscream.Verbosity")); |
36 |
< |
write(this.toString(), Logger.SYSINIT, "started"); |
37 |
< |
write(this.toString(), Logger.SYSMSG, "using verbosity " + _verbosityLevel); |
36 |
> |
write(toString(), Logger.SYSINIT, "started"); |
37 |
> |
write(toString(), Logger.SYSMSG, "using verbosity " + _verbosityLevel); |
38 |
|
} |
39 |
|
|
40 |
|
//---PUBLIC METHODS--- |
54 |
|
/** |
55 |
|
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
56 |
|
* method to provide clean logging (every class should have this). |
57 |
< |
* |
58 |
< |
* This case returns the information from the LoggerImpl, although maybe |
59 |
< |
* it should be merged with this somehow ? |
60 |
< |
* |
57 |
> |
* |
58 |
> |
* This uses the uk.ac.ukc.iscream.util.FormatName class |
59 |
> |
* to format the toString() |
60 |
> |
* |
61 |
|
* @return the name of this class and its CVS revision |
62 |
|
*/ |
63 |
|
public String toString() { |
64 |
< |
return this.getClass().getName() + "(" + REVISION.substring(11, REVISION.length() - 2) + ")"; |
64 |
> |
return FormatName.getName( |
65 |
> |
_name, |
66 |
> |
getClass().getName(), |
67 |
> |
REVISION); |
68 |
|
} |
69 |
+ |
|
70 |
|
//---PRIVATE METHODS--- |
71 |
|
|
72 |
|
//---ACCESSOR/MUTATOR METHODS--- |
82 |
|
* The actual Logger used by this instance |
83 |
|
*/ |
84 |
|
private LoggerImpl _logger; |
85 |
+ |
|
86 |
+ |
/** |
87 |
+ |
* This is the friendly identifier of the |
88 |
+ |
* component this class is running in. |
89 |
+ |
* eg, a Filter may be called "filter1", |
90 |
+ |
* If this class does not have an owning |
91 |
+ |
* component, a name from the configuration |
92 |
+ |
* can be placed here. This name could also |
93 |
+ |
* be changed to null for utility classes. |
94 |
+ |
*/ |
95 |
+ |
private String _name = Core.NAME; |
96 |
|
|
97 |
|
//---STATIC ATTRIBUTES--- |
98 |
|
|