mirror of
https://github.com/FancyInnovations/FancyPlugins.git
synced 2025-12-06 07:43:36 +00:00
fancydialogs: Make log level configurable
This commit is contained in:
@@ -66,6 +66,10 @@ public class FancyDialogsPlugin extends JavaPlugin {
|
|||||||
fdConfig = new FancyDialogsConfig();
|
fdConfig = new FancyDialogsConfig();
|
||||||
fdConfig.load();
|
fdConfig.load();
|
||||||
|
|
||||||
|
if (!fdConfig.getLogLevel().equalsIgnoreCase("INFO")) {
|
||||||
|
fancyLogger.setCurrentLevel(LogLevel.valueOf(fdConfig.getLogLevel().toUpperCase()));
|
||||||
|
}
|
||||||
|
|
||||||
translator = new Translator(new TextConfig("#32e347", "#35ad1d", "#81E366", "#E3CA66", "#E36666", ""));
|
translator = new Translator(new TextConfig("#32e347", "#35ad1d", "#81E366", "#E3CA66", "#E36666", ""));
|
||||||
translator.loadLanguages(getDataFolder().getAbsolutePath());
|
translator.loadLanguages(getDataFolder().getAbsolutePath());
|
||||||
final Language selectedLanguage = translator.getLanguages().stream()
|
final Language selectedLanguage = translator.getLanguages().stream()
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import java.util.List;
|
|||||||
public class FancyDialogsConfig {
|
public class FancyDialogsConfig {
|
||||||
|
|
||||||
private String language;
|
private String language;
|
||||||
|
private String logLevel;
|
||||||
private String welcomeDialogID;
|
private String welcomeDialogID;
|
||||||
private String quickActionsDialogID;
|
private String quickActionsDialogID;
|
||||||
|
|
||||||
@@ -19,6 +20,9 @@ public class FancyDialogsConfig {
|
|||||||
language = (String) ConfigHelper.getOrDefault(config, "language", "default");
|
language = (String) ConfigHelper.getOrDefault(config, "language", "default");
|
||||||
config.setInlineComments("language", List.of("The language of the plugin."));
|
config.setInlineComments("language", List.of("The language of the plugin."));
|
||||||
|
|
||||||
|
logLevel = (String) ConfigHelper.getOrDefault(config, "log_level", "INFO");
|
||||||
|
config.setInlineComments("log_level", List.of("The log level of the plugin. Possible values: DEBUG, INFO, WARN, ERROR."));
|
||||||
|
|
||||||
welcomeDialogID = (String) ConfigHelper.getOrDefault(config, "welcome_dialog_id", "welcome-dialog");
|
welcomeDialogID = (String) ConfigHelper.getOrDefault(config, "welcome_dialog_id", "welcome-dialog");
|
||||||
config.setInlineComments("welcome_dialog_id", List.of("The ID of the dialog which will be shown to the player when they join the server for the first time."));
|
config.setInlineComments("welcome_dialog_id", List.of("The ID of the dialog which will be shown to the player when they join the server for the first time."));
|
||||||
|
|
||||||
@@ -30,6 +34,10 @@ public class FancyDialogsConfig {
|
|||||||
return language;
|
return language;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getLogLevel() {
|
||||||
|
return logLevel;
|
||||||
|
}
|
||||||
|
|
||||||
public String getWelcomeDialogID() {
|
public String getWelcomeDialogID() {
|
||||||
return welcomeDialogID;
|
return welcomeDialogID;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user