Updated some stuff in NetLog
This commit is contained in:
parent
d713c74832
commit
693a629db6
6 changed files with 13 additions and 7 deletions
|
|
@ -36,6 +36,7 @@
|
|||
<menus>
|
||||
<Menu mnemonicParsing="false" text="File">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" text="Open File" />
|
||||
<MenuItem mnemonicParsing="false" onAction="#handleConnectAction" text="Connect" />
|
||||
<Menu mnemonicParsing="false" text="Previous">
|
||||
<items>
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@
|
|||
<children>
|
||||
<TableView fx:id="logTable" prefHeight="146.0" prefWidth="598.0" tableMenuButtonVisible="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<columns>
|
||||
<TableColumn editable="false" prefWidth="75.0" sortable="false" text="Timestamp" fx:id="logTimestampColumn" />
|
||||
<TableColumn editable="false" prefWidth="130.0" sortable="false" text="Timestamp" fx:id="logTimestampColumn" />
|
||||
<TableColumn editable="false" prefWidth="75.0" sortable="false" text="Level" fx:id="logLevelColumn" />
|
||||
<TableColumn editable="false" prefWidth="400.0" sortable="false" text="Log" fx:id="logColumn" />
|
||||
</columns>
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ public class NetLogExceptionMessage extends Message {
|
|||
return false;
|
||||
|
||||
NetLogExceptionMessage other = (NetLogExceptionMessage) obj;
|
||||
if (name.equals(other.name) || message.equals(other.message) ||
|
||||
if (name.equals(other.name) && message.equals(other.message) &&
|
||||
stackTrace.equals(other.stackTrace)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,8 +79,9 @@ public class NetLogGuiClient extends Application{
|
|||
private class NetLoggerClientTab extends Tab{
|
||||
public NetLoggerClientTab(String host, int port) throws IOException{
|
||||
this.setText( host+":"+port );
|
||||
|
||||
Parent tabRoot = FXMLLoader.load(getClass().getResource("NetLogClientInstance.fxml"));
|
||||
|
||||
FXMLLoader loader = new FXMLLoader();
|
||||
Parent tabRoot = loader.load(getClass().getResource("NetLogClientInstance.fxml"));
|
||||
this.setContent(tabRoot);
|
||||
AnchorPane.setRightAnchor(tabRoot, 0.0);
|
||||
//this.setOnClosed(new EventHandler<Event>() {
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ public class NetLogGuiClientInstance implements Initializable, NetLogListener {
|
|||
public void handleExceptionMessage(NetLogExceptionMessage msg) {
|
||||
if(status == Status.RUNNING){
|
||||
exceptionTable.getItems().remove(msg);
|
||||
exceptionTable.getItems().add(msg);
|
||||
exceptionTable.getItems().add(msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,12 +22,16 @@
|
|||
|
||||
package zutil.log.net;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.logging.LogRecord;
|
||||
|
||||
import zutil.net.nio.message.Message;
|
||||
|
||||
public class NetLogMessage extends Message {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final SimpleDateFormat dataFormat =
|
||||
new SimpleDateFormat("yyyy--MM-dd HH:mm:ss");
|
||||
|
||||
private long timestamp;
|
||||
private String level;
|
||||
|
|
@ -53,8 +57,8 @@ public class NetLogMessage extends Message {
|
|||
|
||||
|
||||
|
||||
public long getTimestamp() {
|
||||
return timestamp;
|
||||
public String getTimestamp() {
|
||||
return dataFormat.format(new Date(timestamp));
|
||||
}
|
||||
|
||||
public void setTimestamp(long timestamp) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue