fix slf4j message issue

This commit is contained in:
Loredana 2019-05-21 22:55:03 +03:00
parent dcca85823e
commit d939f25837
1 changed files with 8 additions and 6 deletions

View File

@ -4,6 +4,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ResourceBundle;
import java.text.MessageFormat;
public class Slf4jLogger implements System.Logger {
@ -74,26 +75,27 @@ public class Slf4jLogger implements System.Logger {
if (!isLoggable(level)) {
return;
}
String message = MessageFormat.format (format, params);
switch (level) {
case TRACE:
logger.trace(format, params);
logger.trace(message);
break;
case DEBUG:
logger.debug(format, params);
logger.debug(message);
break;
case INFO:
logger.info(format, params);
logger.info(message);
break;
case WARNING:
logger.warn(format, params);
logger.warn(message);
break;
case ERROR:
logger.error(format, params);
logger.error(message);
break;
case ALL:
default:
logger.info(format, params);
logger.info(message);
}
}
}