java.lang.Object com.realtime.crossfire.jxclient.Logger
public class Logger
Logs received messages to a file.
Field Summary | |
---|---|
private CrossfireDrawextinfoListener |
crossfireDrawextinfoListener
The CrossfireDrawextinfoListener registered to receive
drawextinfo commands. |
private CrossfireDrawinfoListener |
crossfireDrawinfoListener
The CrossfireDrawinfoListener registered to receive drawinfo
commands. |
private CrossfireQueryListener |
crossfireQueryListener
The CrossfireQueryListener registered to receive query commands. |
private boolean |
enabled
Whether the message logger is enabled. |
private static java.text.SimpleDateFormat |
FORMAT
The format for writing timestamps. |
private java.lang.String |
hostname
The hostname. |
Constructor Summary | |
---|---|
Logger(CrossfireServerConnection crossfireServerConnection,
java.lang.String hostname,
boolean enabled)
Create a new instance. |
Method Summary | |
---|---|
private void |
log(java.lang.String message)
Adds a message to the log file. |
void |
setHostname(java.lang.String hostname)
Updates the hostname. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final CrossfireDrawextinfoListener crossfireDrawextinfoListener
CrossfireDrawextinfoListener
registered to receive
drawextinfo commands.
private final CrossfireDrawinfoListener crossfireDrawinfoListener
CrossfireDrawinfoListener
registered to receive drawinfo
commands.
private final CrossfireQueryListener crossfireQueryListener
CrossfireQueryListener
registered to receive query commands.
private final boolean enabled
@NotNull private static final java.text.SimpleDateFormat FORMAT
@Nullable private java.lang.String hostname
Constructor Detail |
---|
public Logger(@NotNull CrossfireServerConnection crossfireServerConnection, @Nullable java.lang.String hostname, boolean enabled)
crossfireServerConnection
- the server connection to monitorhostname
- the hostnameenabled
- whether the message logger is enabledMethod Detail |
---|
private void log(@NotNull java.lang.String message)
message
- the messagepublic void setHostname(@Nullable java.lang.String hostname)
hostname
- the new hostname