Skip to content

Commit b84ad83

Browse files
DingselDingselrtm516
authored
Added config option "suppress-session-update-info" (#143)
* Added config option "suppress-session-update-info" to suppress a log message that would sometimes get spamy * Made suppression option log to debug intead * Apply to change to config explanation text Co-authored-by: rtm516 <rtm516@users.noreply.github.com> --------- Co-authored-by: Dingsel <dshluka@gamil.com> Co-authored-by: rtm516 <rtm516@users.noreply.github.com>
1 parent 08aaef9 commit b84ad83

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

bootstrap/standalone/src/main/java/com/rtm516/mcxboxbroadcast/bootstrap/standalone/StandaloneMain.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ private static void createSession() throws SessionCreationException, SessionUpda
100100
try {
101101
// Update the session
102102
sessionManager.updateSession(sessionInfo);
103-
sessionManager.logger().info("Updated session!");
103+
if (config.suppressSessionUpdateInfo()) {
104+
sessionManager.logger().debug("Updated session!");
105+
} else {
106+
sessionManager.logger().info("Updated session!");
107+
}
104108
} catch (SessionUpdateException e) {
105109
sessionManager.logger().error("Failed to update session", e);
106110
}

bootstrap/standalone/src/main/resources/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ friend-sync:
3636

3737
# Enable debug logs
3838
debug-log: false
39+
40+
# Suppresses "Updated session!" log into debug
41+
suppress-session-update-info: false

core/src/main/java/com/rtm516/mcxboxbroadcast/core/configs/StandaloneConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
public record StandaloneConfig(
66
@JsonProperty("session") SessionConfig session,
77
@JsonProperty("debug-log") boolean debugLog,
8+
@JsonProperty("suppress-session-update-info") boolean suppressSessionUpdateInfo,
89
@JsonProperty("friend-sync") FriendSyncConfig friendSync) {
910
}

0 commit comments

Comments
 (0)