Skip to content

Commit c45662c

Browse files
committed
improve toString for DnsCacheEntry
1 parent e082fec commit c45662c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

library/src/main/java/com/alibaba/dcm/DnsCacheEntry.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.alibaba.dcm;
22

33
import java.io.Serializable;
4+
import java.text.SimpleDateFormat;
45
import java.util.Arrays;
56
import java.util.Date;
67

@@ -44,10 +45,12 @@ public DnsCacheEntry(String host, String[] ips, Date expiration) {
4445

4546
@Override
4647
public String toString() {
48+
final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSZ");
49+
4750
return "DnsCacheEntry{" +
4851
"host='" + host + '\'' +
4952
", ips=" + Arrays.toString(ips) +
50-
", expiration=" + expiration +
53+
", expiration=" + dateFormat.format(expiration) +
5154
'}';
5255
}
5356

0 commit comments

Comments
 (0)