Use Log4J message template instead of String.format (#1673)

* Factorise metrics code for KeyValueStorage database

- introduce `MonitorableKeyValueStorage`
- factorise code
- remove metrics instanciation in `RocksDbKeyValueStorage` and `ColumnarRocksDbKeyValueStorage`

* Rename class

* Use Log4J message template instead of String.format

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
Abdelhamid Bakhta 5 years ago committed by GitHub
parent 5da905874b
commit 61451323fc
  1. 2
      ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/AdminChangeLogLevel.java

@ -44,7 +44,7 @@ public class AdminChangeLogLevel implements JsonRpcMethod {
public JsonRpcResponse response(final JsonRpcRequest request) {
try {
final Level logLevel = parameters.required(request.getParams(), 0, Level.class);
LOG.log(Level.OFF, String.format("Setting logging level to %s", logLevel.name()));
LOG.log(Level.OFF, "Setting logging level to {}", logLevel.name());
Configurator.setAllLevels("", logLevel);
return new JsonRpcSuccessResponse(request.getId());
} catch (InvalidJsonRpcParameters invalidJsonRpcParameters) {

Loading…
Cancel
Save