diff options
author | Mavlushechka <mavlushechka@gmail.com> | 2022-11-16 14:54:25 +0500 |
---|---|---|
committer | Mavlushechka <mavlushechka@gmail.com> | 2022-11-16 15:06:42 +0500 |
commit | ac47d5ddc69b4a210821374467c0e175148fd1af (patch) | |
tree | 7832c43216d3c3bd409c991bfe725739e6b0a746 /src/main/java/com/mavlushechka/a1qa/framework | |
parent | 0040cf96449ab6a2c109ce8f6a0ca88f2182e97c (diff) |
Remove LoggerUtils class
Diffstat (limited to 'src/main/java/com/mavlushechka/a1qa/framework')
-rw-r--r-- | src/main/java/com/mavlushechka/a1qa/framework/utils/IntegerUtils.java | 4 | ||||
-rw-r--r-- | src/main/java/com/mavlushechka/a1qa/framework/utils/LoggerUtils.java | 46 |
2 files changed, 3 insertions, 47 deletions
diff --git a/src/main/java/com/mavlushechka/a1qa/framework/utils/IntegerUtils.java b/src/main/java/com/mavlushechka/a1qa/framework/utils/IntegerUtils.java index 5b6b7da..0c31639 100644 --- a/src/main/java/com/mavlushechka/a1qa/framework/utils/IntegerUtils.java +++ b/src/main/java/com/mavlushechka/a1qa/framework/utils/IntegerUtils.java @@ -1,5 +1,7 @@ package com.mavlushechka.a1qa.framework.utils; +import aquality.selenium.browser.AqualityServices; + import java.util.OptionalInt; import java.util.Random; @@ -14,7 +16,7 @@ public class IntegerUtils { if (randomNumber.isPresent()) { return randomNumber.getAsInt(); } - LoggerUtils.error("Incorrect min and max arguments."); + AqualityServices.getLogger().error("Incorrect min and max arguments."); throw new IllegalArgumentException("Incorrect min and max arguments."); } diff --git a/src/main/java/com/mavlushechka/a1qa/framework/utils/LoggerUtils.java b/src/main/java/com/mavlushechka/a1qa/framework/utils/LoggerUtils.java deleted file mode 100644 index 8675d92..0000000 --- a/src/main/java/com/mavlushechka/a1qa/framework/utils/LoggerUtils.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.mavlushechka.a1qa.framework.utils; - -import org.apache.logging.log4j.Level; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.core.config.ConfigurationSource; -import org.apache.logging.log4j.core.config.Configurator; -import org.apache.logging.log4j.core.config.xml.XmlConfiguration; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; - -public class LoggerUtils { - - private final static File CONFIGURATION_FILE = new File("src/main/resources/log4j2.xml"); - private static Logger logger; - private static int step = 0; - - - private LoggerUtils() { - } - - public static void initialize() { - try { - Configurator.initialize(new XmlConfiguration(null, new ConfigurationSource(new FileInputStream(CONFIGURATION_FILE)))); - } catch (IOException ioException) { - throw new RuntimeException(ioException); - } - logger = LogManager.getLogger(); - } - - public static void step(String text) { - step++; - info("Step %d: %s".formatted(step, text)); - } - - public static void info(String text) { - logger.log(Level.INFO, text); - } - - public static void error(String text) { - logger.log(Level.ERROR, text); - } - -} |