Skip to content

Commit

Permalink
Improve printing of log messages on AS and GM
Browse files Browse the repository at this point in the history
Signed-off-by: Rikard Höglund <rikard.hoglund@ri.se>
  • Loading branch information
rikard-sics committed May 6, 2023
1 parent 2758d56 commit 8e50aa7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ace/src/main/java/se/sics/ace/as/logging/DhtLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ static public void sendLog(String type, String priority, String category, String
return;
}

// Print message to be logged
System.out.println("[LOG] " + message);
// Print information about message to be logged
message = device + ": " + message;
System.out.format("[LOG] \"%s\" (Type: %s, Priority: %s, Category: %s)%n", message, type, priority, category);

// If a connection is not established yet (which should
// have been done from the application), do it now
Expand All @@ -113,7 +114,6 @@ static public void sendLog(String type, String priority, String category, String
logsVal.setPriority(priority);
logsVal.setCategory(category);

message = device + ": " + message;
int maxLen = Math.min(message.length(), LOG_MAX_LEN);
logsVal.setMessage(message.substring(0, maxLen));

Expand Down

0 comments on commit 8e50aa7

Please sign in to comment.