Fixed logger
This commit is contained in:
parent
bc8a8b9141
commit
ebbabea0b9
|
|
@ -19,6 +19,7 @@ import com.velocitypowered.api.plugin.Dependency;
|
||||||
import com.velocitypowered.api.plugin.Plugin;
|
import com.velocitypowered.api.plugin.Plugin;
|
||||||
import com.velocitypowered.api.plugin.annotation.DataDirectory;
|
import com.velocitypowered.api.plugin.annotation.DataDirectory;
|
||||||
import com.velocitypowered.api.proxy.ProxyServer;
|
import com.velocitypowered.api.proxy.ProxyServer;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
|
@ -33,14 +34,14 @@ public class DiscordLink {
|
||||||
|
|
||||||
private static DiscordLink plugin;
|
private static DiscordLink plugin;
|
||||||
private final ProxyServer server;
|
private final ProxyServer server;
|
||||||
private final ALogger logger;
|
private final Logger logger;
|
||||||
private final Path dataDirectory;
|
private final Path dataDirectory;
|
||||||
private final Database database;
|
private final Database database;
|
||||||
private final Cache cache;
|
private final Cache cache;
|
||||||
private Bot bot;
|
private Bot bot;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public DiscordLink(ProxyServer proxyServer, ALogger proxyLogger, @DataDirectory Path proxydataDirectory)
|
public DiscordLink(ProxyServer proxyServer, Logger proxyLogger, @DataDirectory Path proxydataDirectory)
|
||||||
{
|
{
|
||||||
plugin = this;
|
plugin = this;
|
||||||
server = proxyServer;
|
server = proxyServer;
|
||||||
|
|
@ -98,7 +99,7 @@ public class DiscordLink {
|
||||||
return plugin;
|
return plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ALogger getLogger() {
|
public Logger getLogger() {
|
||||||
return logger;
|
return logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,24 @@
|
||||||
package com.alttd.proxydiscordlink.util;
|
package com.alttd.proxydiscordlink.util;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
public class ALogger {
|
public class ALogger {
|
||||||
|
|
||||||
private static ALogger logger;
|
private static Logger logger;
|
||||||
|
|
||||||
public static void init(ALogger log) {
|
public static void init(Logger log) {
|
||||||
logger = log;
|
logger = log;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void log(String message) {
|
|
||||||
logger.log(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void warn(String message) {
|
public static void warn(String message) {
|
||||||
logger.log("WARNING: " + message);
|
logger.warn(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void info(String message) {
|
public static void info(String message) {
|
||||||
logger.log("INFO: " + message);
|
logger.info(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void error(String message) {
|
public static void error(String message) {
|
||||||
logger.log("ERROR: " + message);
|
logger.error(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user