diff --git a/src/main/java/jenkinsci/plugins/telegrambot/TelegramBotGlobalConfiguration.java b/src/main/java/jenkinsci/plugins/telegrambot/TelegramBotGlobalConfiguration.java index f954e77..524e59a 100644 --- a/src/main/java/jenkinsci/plugins/telegrambot/TelegramBotGlobalConfiguration.java +++ b/src/main/java/jenkinsci/plugins/telegrambot/TelegramBotGlobalConfiguration.java @@ -32,7 +32,7 @@ public class TelegramBotGlobalConfiguration extends GlobalConfiguration { final static String PLUGIN_DISPLAY_NAME = "TelegramBot"; private final Map botStrings; - private Boolean shouldLogToConsole; + private Boolean shouldLogToConsole = Boolean.TRUE; private String botToken; private String botName; private String usernames; @@ -72,7 +72,7 @@ public boolean configure(StaplerRequest req, JSONObject formData) throws FormExc StaplerRequestContainer.req = req; // Getting simple params from formData - setLogToConsole(formData.getBoolean("shouldLogToConsole")); + setShouldLogToConsole(formData.getBoolean("shouldLogToConsole")); setBotToken(formData.getString("botToken")); setBotName(formData.getString("botName")); @@ -109,11 +109,11 @@ public Map getBotStrings() { return botStrings; } - public Boolean shouldLogToConsole() { + public Boolean isShouldLogToConsole() { return shouldLogToConsole; } - public void setLogToConsole(Boolean shouldLogToConsole) { + public void setShouldLogToConsole(Boolean shouldLogToConsole) { this.shouldLogToConsole = shouldLogToConsole; } diff --git a/src/main/java/jenkinsci/plugins/telegrambot/telegram/TelegramBot.java b/src/main/java/jenkinsci/plugins/telegrambot/telegram/TelegramBot.java index 5b7e0ab..b6161f4 100644 --- a/src/main/java/jenkinsci/plugins/telegrambot/telegram/TelegramBot.java +++ b/src/main/java/jenkinsci/plugins/telegrambot/telegram/TelegramBot.java @@ -106,7 +106,7 @@ public void sendMessage( LOG.log(Level.SEVERE, "Error while sending the message", e); } - if (CONFIG.shouldLogToConsole()) taskListener.getLogger().println(logMessage); + if (CONFIG.isShouldLogToConsole()) taskListener.getLogger().println(logMessage); } @Override diff --git a/src/main/resources/jenkinsci/plugins/telegrambot/TelegramBotGlobalConfiguration/config.jelly b/src/main/resources/jenkinsci/plugins/telegrambot/TelegramBotGlobalConfiguration/config.jelly index f8ef28c..f2f6212 100644 --- a/src/main/resources/jenkinsci/plugins/telegrambot/TelegramBotGlobalConfiguration/config.jelly +++ b/src/main/resources/jenkinsci/plugins/telegrambot/TelegramBotGlobalConfiguration/config.jelly @@ -22,7 +22,7 @@ - +