Revert to StringBuilder and stacking stream line!

This commit is contained in:
kohlerpop1
2023-12-22 12:22:50 -05:00
parent b0bf4ac606
commit ea525470e2
2 changed files with 10 additions and 5 deletions

View File

@@ -136,10 +136,12 @@ public class TikTokLiveClientBuilder implements LiveClientBuilder {
handler.setFormatter(new Formatter() {
@Override
public String format(LogRecord record) {
return ConsoleColors.GREEN + "[" + record.getLoggerName() + "] " +
ConsoleColors.GREEN + "[" + record.getLevel() + "]: " +
ConsoleColors.WHITE_BRIGHT + record.getMessage() +
ConsoleColors.RESET + "\n";
var sb = new StringBuilder();
sb.append(ConsoleColors.GREEN).append("[").append(record.getLoggerName()).append("] ");
sb.append(ConsoleColors.GREEN).append("[").append(record.getLevel()).append("]: ");
sb.append(ConsoleColors.WHITE_BRIGHT).append(record.getMessage());
sb.append(ConsoleColors.RESET).append("\n");
return sb.toString();
}
});
logger.setUseParentHandlers(false);

View File

@@ -40,6 +40,9 @@ public class TikTokCookieJar {
}
public String parseCookies() {
return cookies.entrySet().stream().map(entry -> entry.getKey()+"="+entry.getValue()+";").collect(Collectors.joining());
return cookies.entrySet()
.stream()
.map(entry -> entry.getKey()+"="+entry.getValue()+";")
.collect(Collectors.joining());
}
}