migrated to slf4j
This commit is contained in:
@ -29,13 +29,8 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-api</artifactId>
|
||||
<type>jar</type>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@ -2,9 +2,8 @@ package de.muehlencord.shared.util;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.text.ParseException;
|
||||
import org.apache.logging.log4j.Level;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -13,7 +12,7 @@ import org.apache.logging.log4j.Logger;
|
||||
public abstract class StringUtil {
|
||||
|
||||
/** the logging object */
|
||||
private static final Logger LOGGER = LogManager.getLogger(StringUtil.class);
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(StringUtil.class);
|
||||
|
||||
/**
|
||||
* returns the given string in ISO-8859-1 encoding
|
||||
@ -28,7 +27,7 @@ public abstract class StringUtil {
|
||||
byte[] b = input.getBytes("UTF-8");
|
||||
return new String(b, "ISO-8859-1");
|
||||
} catch (UnsupportedEncodingException ex) {
|
||||
LOGGER.log (Level.DEBUG, ex.toString(), ex);
|
||||
LOGGER.debug (ex.toString(), ex);
|
||||
throw new StringEncodingException("Cannot convert string from UTF-8 to ISO-8859-1. Reason: " + ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,9 +19,8 @@ import java.text.Format;
|
||||
import static java.util.Arrays.asList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import org.apache.logging.log4j.Level;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -32,7 +31,7 @@ public abstract class FileUtil {
|
||||
/**
|
||||
* the logging object
|
||||
*/
|
||||
private static final Logger LOGGER = LogManager.getLogger(FileUtil.class);
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(FileUtil.class);
|
||||
|
||||
/**
|
||||
* returns a list of files found by the given regexp in the given folder
|
||||
@ -203,7 +202,7 @@ public abstract class FileUtil {
|
||||
message = s.toString();
|
||||
} catch (FileNotFoundException fnex) {
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
LOGGER.log(Level.DEBUG, "Error occured while readoing file. Reason:" + fnex, fnex);
|
||||
LOGGER.debug("Error occured while readoing file. Reason:" + fnex, fnex);
|
||||
}
|
||||
throw new FileNotFoundException("Error occured while reading file. Reason:" + fnex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user