Open hyori opened 11 years ago
we could use Logger from the java api... but I've never used it before....
We should make this a very general listening interface: the admin node produces a continuous stream of status messages, which is send to a set of listeners registered with the admin node Listeners can be either remote listeners (the GUI connecting to a remote process) or local ones that either output stdout or write to a log file. This way we have no duplication.
This is the pattern that I see being used in most bigger projects.
i.e
interface IDebugListener {
public void write(string message);
}
class DebugListenerSet extends ArrayList<IDebugListener> {
public void write(string message) {
for(IDebugListener listener : this) {
listener.write(message);
}
}
}
:dancers:
and AdminCacheNode
then maintain a DebugListenerSet
and write to that instead of println
. IDebugListener
then be implemented for handling different destinations, such as : log file, sysout, remote connection to admin cache node.
The remote debugging via the admin needs a more elaborate API built on top of that because we also must transfer the grid and other data structures.
Hey dudes,
What if we added in AdminNode.java the capability to log files in case stuff goes wrong?