remove jline and adjust logging
This commit is contained in:
parent
2b3423c1c9
commit
614ca976b9
@ -32,7 +32,6 @@ dependencies {
|
|||||||
implementation(libs.logback)
|
implementation(libs.logback)
|
||||||
implementation(libs.log4jtoslf4j)
|
implementation(libs.log4jtoslf4j)
|
||||||
implementation(libs.jultoslf4j)
|
implementation(libs.jultoslf4j)
|
||||||
implementation(libs.jline)
|
|
||||||
|
|
||||||
implementation(libs.marinaralib)
|
implementation(libs.marinaralib)
|
||||||
implementation(libs.marinarajavacord)
|
implementation(libs.marinarajavacord)
|
||||||
|
@ -1,12 +1,8 @@
|
|||||||
package net.tomatentum.tomatenmusic3;
|
package net.tomatentum.tomatenmusic3;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import org.javacord.api.DiscordApi;
|
import org.javacord.api.DiscordApi;
|
||||||
import org.javacord.api.DiscordApiBuilder;
|
import org.javacord.api.DiscordApiBuilder;
|
||||||
import org.javacord.api.entity.intent.Intent;
|
import org.javacord.api.entity.intent.Intent;
|
||||||
import org.jline.terminal.Terminal;
|
|
||||||
import org.jline.terminal.TerminalBuilder;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ -26,7 +22,6 @@ public class App {
|
|||||||
private Config config;
|
private Config config;
|
||||||
private DiscordApi client;
|
private DiscordApi client;
|
||||||
private Logger logger = LoggerFactory.getLogger(getClass());
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
||||||
private Terminal terminal;
|
|
||||||
|
|
||||||
private Marinara marinara;
|
private Marinara marinara;
|
||||||
|
|
||||||
@ -37,7 +32,6 @@ public class App {
|
|||||||
LoggerContext loggerctx = (LoggerContext) LoggerFactory.getILoggerFactory();
|
LoggerContext loggerctx = (LoggerContext) LoggerFactory.getILoggerFactory();
|
||||||
if (config.isDevelopment())
|
if (config.isDevelopment())
|
||||||
loggerctx.getLogger("root").setLevel(Level.DEBUG);
|
loggerctx.getLogger("root").setLevel(Level.DEBUG);
|
||||||
initJline();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void connect() {
|
public void connect() {
|
||||||
@ -49,15 +43,6 @@ public class App {
|
|||||||
logger.info("connected as {}", client.getYourself().getName());
|
logger.info("connected as {}", client.getYourself().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initJline() {
|
|
||||||
try {
|
|
||||||
this.terminal = TerminalBuilder.terminal();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
JlineAppender.Terminal = this.terminal;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initMarinara() {
|
private void initMarinara() {
|
||||||
this.marinara = Marinara.load(new JavacordWrapper(client));
|
this.marinara = Marinara.load(new JavacordWrapper(client));
|
||||||
|
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
package net.tomatentum.tomatenmusic3;
|
|
||||||
|
|
||||||
import java.io.PrintWriter;
|
|
||||||
|
|
||||||
import org.jline.terminal.Terminal;
|
|
||||||
|
|
||||||
import ch.qos.logback.classic.spi.ILoggingEvent;
|
|
||||||
import ch.qos.logback.core.ConsoleAppender;
|
|
||||||
|
|
||||||
public class JlineAppender extends ConsoleAppender<ILoggingEvent> {
|
|
||||||
|
|
||||||
public static Terminal Terminal;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void append(ILoggingEvent event) {
|
|
||||||
PrintWriter terminalWriter = Terminal.writer();
|
|
||||||
terminalWriter.write(new String(super.encoder.encode(event)));
|
|
||||||
terminalWriter.flush();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,11 +1,11 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<appender name="jline" class="net.tomatentum.tomatenmusic3.JlineAppender">
|
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
<encoder>
|
<encoder>
|
||||||
<pattern>%d{STRICT} %-30.-30t %-56([%boldWhite(%logger{40})]) %highlight(%p): %msg%n</pattern>
|
<pattern>%d{STRICT} %-20.-20t %-46([%boldWhite(%logger{30})]) %highlight(%p): %msg%n</pattern>
|
||||||
</encoder>
|
</encoder>
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<root level="info">
|
<root level="info">
|
||||||
<appender-ref ref="jline" />
|
<appender-ref ref="STDOUT" />
|
||||||
</root>
|
</root>
|
||||||
</configuration>
|
</configuration>
|
@ -2,7 +2,6 @@
|
|||||||
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format
|
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format
|
||||||
|
|
||||||
[versions]
|
[versions]
|
||||||
guava = "33.0.0-jre"
|
|
||||||
junit-jupiter = "5.10.2"
|
junit-jupiter = "5.10.2"
|
||||||
javacord = "3.8.0"
|
javacord = "3.8.0"
|
||||||
dotenv = "3.0.0"
|
dotenv = "3.0.0"
|
||||||
@ -10,11 +9,9 @@ logback = "1.5.15"
|
|||||||
slf4j = "2.0.16"
|
slf4j = "2.0.16"
|
||||||
log4jtoslf4j = "2.24.3"
|
log4jtoslf4j = "2.24.3"
|
||||||
jultoslf4j = "2.0.16"
|
jultoslf4j = "2.0.16"
|
||||||
jline = "3.26.3"
|
|
||||||
marinara = "1.0.0-RC1-9d88ca9"
|
marinara = "1.0.0-RC1-9d88ca9"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
guava = { module = "com.google.guava:guava", version.ref = "guava" }
|
|
||||||
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit-jupiter" }
|
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit-jupiter" }
|
||||||
javacord = { module = "org.javacord:javacord", version.ref = "javacord" }
|
javacord = { module = "org.javacord:javacord", version.ref = "javacord" }
|
||||||
dotenv = { module = "io.github.cdimascio:dotenv-java", version.ref = "dotenv"}
|
dotenv = { module = "io.github.cdimascio:dotenv-java", version.ref = "dotenv"}
|
||||||
@ -22,7 +19,6 @@ logback = { module = "ch.qos.logback:logback-classic", version.ref = "logback"}
|
|||||||
slf4j = { module = "org.slf4j:slf4j-api", version.ref = "slf4j"}
|
slf4j = { module = "org.slf4j:slf4j-api", version.ref = "slf4j"}
|
||||||
log4jtoslf4j = { module = "org.apache.logging.log4j:log4j-to-slf4j", version.ref = "log4jtoslf4j"}
|
log4jtoslf4j = { module = "org.apache.logging.log4j:log4j-to-slf4j", version.ref = "log4jtoslf4j"}
|
||||||
jultoslf4j = { module = "org.slf4j:jul-to-slf4j", version.ref = "jultoslf4j"}
|
jultoslf4j = { module = "org.slf4j:jul-to-slf4j", version.ref = "jultoslf4j"}
|
||||||
jline = { module = "org.jline:jline", version.ref = "jline"}
|
|
||||||
|
|
||||||
marinaralib = { module = "net.tomatentum.Marinara:lib-dev", version.ref = "marinara"}
|
marinaralib = { module = "net.tomatentum.Marinara:lib-dev", version.ref = "marinara"}
|
||||||
marinarajavacord = { module = "net.tomatentum.Marinara:wrapper-javacord-dev", version.ref = "marinara"}
|
marinarajavacord = { module = "net.tomatentum.Marinara:wrapper-javacord-dev", version.ref = "marinara"}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user