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();
if (!loggerName.isEmpty() && !loggerName.contains(".")) {
entry = "[" + event.getLoggerName() + "] " + entry;
final String[] loggerNameSplit = event.getLoggerName().split("\\.");
final String loggerName = loggerNameSplit[loggerNameSplit.length - 1].trim();
if (!loggerName.isEmpty()) {
entry = "[" + loggerName + "] " + entry;
}
messageQueue.addAll(Splitter.fixedLength(Message.MAX_CONTENT_LENGTH - 50).splitToList(