Shorten logger names for Discord module console relay

This commit is contained in:
Josh Roy 2023-06-20 11:06:13 -04:00
parent 803d800bdd
commit 1921abd310

View File

@ -78,9 +78,10 @@ public class ConsoleInjector extends AbstractAppender {
} }
} }
final String loggerName = event.getLoggerName(); final String[] loggerNameSplit = event.getLoggerName().split("\\.");
if (!loggerName.isEmpty() && !loggerName.contains(".")) { final String loggerName = loggerNameSplit[loggerNameSplit.length - 1].trim();
entry = "[" + event.getLoggerName() + "] " + entry; if (!loggerName.isEmpty()) {
entry = "[" + loggerName + "] " + entry;
} }
messageQueue.addAll(Splitter.fixedLength(Message.MAX_CONTENT_LENGTH - 50).splitToList( messageQueue.addAll(Splitter.fixedLength(Message.MAX_CONTENT_LENGTH - 50).splitToList(