Skip to content

Commit a036bc4

Browse files
committed
minor changes in log messages.
1 parent 071d8eb commit a036bc4

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

src/net/sharksystem/asap/ASAPPeerFS.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ public void sendASAPMessage(CharSequence appName, CharSequence uri, byte[] messa
8282
}
8383
catch(ASAPException e) {
8484
// no online peers - that's ok
85-
Log.writeLog(this, "(" + this.getInternalPeer().getOwner()
86-
+ "could not send message online - that's ok.");
85+
Log.writeLog(this, this.toString(), "could not send message online - that's ok.");
8786
}
8887
} catch (IOException e) {
8988
this.log(e.getLocalizedMessage());
@@ -99,4 +98,8 @@ public void sendOnlineASAPMessage(CharSequence appName, CharSequence uri, byte[]
9998
this.getInternalPeer().sendOnlineASAPAssimilateMessage(appName, uri, message);
10099

101100
}
101+
102+
public String toString() {
103+
return this.getInternalPeer().getOwner().toString();
104+
}
102105
}

src/net/sharksystem/asap/apps/testsupport/ASAPTestPeerFS.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,4 @@ public void run() {
7070
}
7171
}).start();
7272
}
73-
7473
}

src/net/sharksystem/asap/utils/Helper.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,20 @@ public static ASAPMessages getMessagesByChunkReceivedInfos(String format, String
147147
return null;
148148
}
149149

150+
public static String collOfCharSequence2DebugOutput(Collection<CharSequence> coll) {
151+
if(coll == null || coll.isEmpty()) return "null/empty";
152+
153+
StringBuilder sb = new StringBuilder();
154+
boolean first = true;
155+
for(CharSequence c : coll) {
156+
if(!first) sb.append(" | ");
157+
else first = false;
158+
sb.append(c);
159+
}
160+
161+
return sb.toString();
162+
}
163+
150164
public static final boolean sameByteArray(byte[] a, byte[] b) {
151165
if(a == null && b == null) return true;
152166
if(a.length != b.length) return false;

0 commit comments

Comments
 (0)