mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
modify logger calls for computable messages via closures
This commit is contained in:
@@ -89,7 +89,7 @@ public class S3Uploader implements ScenarioMetadataAware {
|
||||
combined
|
||||
)
|
||||
.orElseThrow();
|
||||
logger.debug("S3 composite URL is '" + url + "'");
|
||||
logger.debug(() -> "S3 composite URL is '" + url + "'");
|
||||
|
||||
S3UrlFields fields = S3UrlFields.fromURLString(url);
|
||||
S3ClientCache s3ClientCache = new S3ClientCache();
|
||||
|
||||
@@ -37,7 +37,7 @@ public class ScriptingMetrics {
|
||||
public ScriptingGauge newGauge(String name, double initialValue) {
|
||||
ScriptingGauge scriptingGauge = new ScriptingGauge(name, initialValue);
|
||||
ActivityMetrics.gauge(scriptContext,name, scriptingGauge);
|
||||
logger.info("registered scripting gauge:" + name);
|
||||
logger.info(() -> "registered scripting gauge:" + name);
|
||||
return scriptingGauge;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public class ShutdownHookPlugin {
|
||||
Thread runnable = new ShutdownRunnableFunction(logger, name, (Function<?,?>)f);
|
||||
runnable.setName(shutdownName);
|
||||
Runtime.getRuntime().addShutdownHook(runnable);
|
||||
logger.info("Registered shutdown hook to run under name '" + shutdownName + "'");
|
||||
logger.info(() -> "Registered shutdown hook to run under name '" + shutdownName + "'");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,13 +34,13 @@ public class ShutdownRunnableFunction extends Thread {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
logger.info("Running shutdown hook '" + name + "'...");
|
||||
logger.info(() -> "Running shutdown hook '" + name + "'...");
|
||||
try {
|
||||
Object result = function.apply(new Object[0]);
|
||||
if (result instanceof CharSequence) {
|
||||
logger.info("shutdown hook returned output:\n" + result);
|
||||
logger.info(() -> "shutdown hook returned output:\n" + result);
|
||||
}
|
||||
logger.info("Completed shutdown hook '" + name + "'...");
|
||||
logger.info(() -> "Completed shutdown hook '" + name + "'...");
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
@@ -84,8 +84,8 @@ public class TestOptimoExperiments {
|
||||
);
|
||||
PointValuePair result = mo.optimize(od.toArray(new OptimizationData[0]));
|
||||
|
||||
logger.debug(
|
||||
"point:" + Arrays.toString(result.getPoint()) +
|
||||
logger.debug(() ->
|
||||
"point:" + Arrays.toString(result.getPoint()) +
|
||||
" value=" + m.value(result.getPoint())
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user