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