migrated to slf4j

This commit is contained in:
jomu
2015-12-27 15:54:06 +00:00
parent 055d2dffd9
commit 88a180703a
34 changed files with 123 additions and 216 deletions

View File

@ -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);
}
}

View File

@ -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);
}