Skip to content

Commit bdda2e3

Browse files
committed
Additional information in save-and-restore log entry
1 parent 63239f7 commit bdda2e3

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

app/save-and-restore/logging/src/main/java/org/phoebus/applications/saveandrestore/logging/Messages.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
public class Messages {
2424

2525
public static String LogbookCredentialsMissing;
26+
public static String SnapshotCreated;
27+
public static String SnapshotRestored;
2628

2729
static
2830
{

app/save-and-restore/logging/src/main/java/org/phoebus/applications/saveandrestore/logging/SaveAndRestoreEventLogger.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import org.phoebus.security.tokens.ScopedAuthenticationToken;
3333
import org.phoebus.security.tokens.SimpleAuthenticationToken;
3434

35+
import java.text.MessageFormat;
3536
import java.time.Instant;
3637
import java.util.ArrayList;
3738
import java.util.Collection;
@@ -116,6 +117,7 @@ protected String getSnapshotInfoTable(Node node) {
116117
// This is needed!
117118
stringBuilder.append("|-|-|\n");
118119
stringBuilder.append("| Snapshot name | ").append(node.getName()).append(" |\n");
120+
stringBuilder.append("| Comment | ").append(node.getProperty("comment")).append(" |\n");
119121
stringBuilder.append("| Created | ").append(node.getCreated()).append(" |\n");
120122
String isGolden = node.getProperty("golden");
121123
stringBuilder.append("| Golden | ").append("true".equals(isGolden) ? "yes" : "no").append(" |\n");
@@ -155,7 +157,7 @@ public String getOwner() {
155157

156158
@Override
157159
public String getTitle() {
158-
return "New snapshot created";
160+
return MessageFormat.format(Messages.SnapshotCreated, node.getName());
159161
}
160162

161163
@Override
@@ -267,7 +269,7 @@ public LogEntryRestoreImpl(Node node, List<String> failedPVs) {
267269

268270
@Override
269271
public String getTitle() {
270-
return "Snapshot restored";
272+
return MessageFormat.format(Messages.SnapshotRestored, node.getName());
271273
}
272274

273275
@Override
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
LogbookCredentialsMissing=No logbook credentials found
1+
LogbookCredentialsMissing=No logbook credentials found
2+
SnapshotCreated=Snapshot {0} created
3+
SnapshotRestored=Snapshot {0} restored

0 commit comments

Comments
 (0)