package com.mavlushechka.animarfo; import com.mavlushechka.animarfo.telegram.bot.Bot; import org.jetbrains.annotations.NotNull; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.util.Properties; import java.util.logging.Level; import java.util.logging.LogManager; import java.util.logging.Logger; public class App { public static final Properties PROPERTIES = loadProperties(new File("src/main/resources/app.properties")); private static final Logger LOGGER = Logger.getLogger(App.class.getName()); static { try { FileInputStream fileInputStream = new FileInputStream("log.config"); LogManager.getLogManager().readConfiguration(fileInputStream); } catch (IOException ioException) { ioException.printStackTrace(); } LOGGER.setLevel(Level.ALL); } public static void main(String[] args) { LOGGER.info("Trying to start bot"); Bot.start(); } @NotNull private static Properties loadProperties(File file) { Properties properties = new Properties(); try (FileInputStream fis = new FileInputStream(file)) { properties.load(fis); } catch (IOException ioException) { ioException.printStackTrace(); } return properties; } }