Merge pull request #7006 from eugenp/java9-logging-issue

fix slf4j message issue
This commit is contained in:
Loredana Crusoveanu 2019-05-23 22:48:55 +03:00 committed by GitHub
commit c15baecbde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);
}
}
}