mirror of https://github.com/rusefi/rusefi.git
logging improvements
This commit is contained in:
parent
9549a56b9c
commit
5c1e3a2536
|
@ -127,7 +127,7 @@ public class IncomingDataBuffer {
|
|||
while (cbb.length() < count) {
|
||||
int timeout = (int) (startTimestamp + timeoutMs - System.currentTimeMillis());
|
||||
if (timeout <= 0) {
|
||||
log.info(loggingMessage + ": timeout. Got only " + cbb.length());
|
||||
log.info(loggingMessage + ": timeout. Got only " + cbb.length() + " while expecting " + count);
|
||||
return true; // timeout. Sad face.
|
||||
}
|
||||
try {
|
||||
|
|
|
@ -41,6 +41,18 @@ public interface IoStream extends WriteStream, Closeable, StreamStatistics {
|
|||
return r.toString();
|
||||
}
|
||||
|
||||
static String printByteArray(byte[] data) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (byte b : data) {
|
||||
if (Character.isJavaIdentifierPart(b)) {
|
||||
sb.append((char) b);
|
||||
} else {
|
||||
sb.append(' ');
|
||||
}
|
||||
}
|
||||
return printHexBinary(data) + sb;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
default BinaryProtocolServer.Packet readPacket() throws IOException {
|
||||
short length = readShort();
|
||||
|
|
Loading…
Reference in New Issue