com.github.kunalk16.excel.utils.logger.ExcelLogger Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lightExcelReader Show documentation
Show all versions of lightExcelReader Show documentation
A lightweight Java framework to read .xlsx excel files.
package com.github.kunalk16.excel.utils.logger;
import java.util.function.Consumer;
import java.util.logging.Logger;
public class ExcelLogger {
private final Logger logger;
private boolean logMessages;
ExcelLogger() {
this.logger = Logger.getLogger("ExcelReaderLogger");
this.logMessages = false;
}
public void enableLogging(boolean logMessages) {
this.logMessages = logMessages;
}
public void info(String message) {
this.log(this.logger::info, message);
}
public void warning(String message) {
this.log(this.logger::warning, message);
}
public void severe(String message) {
this.log(this.logger::severe, message);
}
private void log(Consumer logConsumer, String message) {
if (this.logMessages) {
logConsumer.accept(message);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy