From ee138cb5a90439f4dea76250d9d4d84166304a5f Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 4 Jul 2024 07:49:35 +0100 Subject: [PATCH] update format for messages in logging --- .../fascinated/bat/features/logging/LogFeature.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/cc/fascinated/bat/features/logging/LogFeature.java b/src/main/java/cc/fascinated/bat/features/logging/LogFeature.java index 76133c0..ae208aa 100644 --- a/src/main/java/cc/fascinated/bat/features/logging/LogFeature.java +++ b/src/main/java/cc/fascinated/bat/features/logging/LogFeature.java @@ -56,6 +56,15 @@ public class LogFeature extends Feature { * @return the formatted content */ public String formatContent(String content) { - return content.length() > 512 ? PasteUtils.uploadPaste(content).getUrl() : "\n```\n%s\n```".formatted(content); + if (content == null) { + return "No content"; + } + if (content.length() > 512) { + return "Content too long, [click here to view]("+PasteUtils.uploadPaste(content)+")"; + } + if (content.length() <= 32) { + return "`%s`".formatted(content); + } + return "\n```\n%s\n```".formatted(content); } }