}
private static File ensurePropertyIsAbsolutePath(Props props, String propKey) {
- File homeDir = props.nonNullValueAsFile(PATH_HOME);
// default values are set by ProcessProperties
String path = props.nonNullValue(propKey);
File d = new File(path);
if (!d.isAbsolute()) {
+ File homeDir = props.nonNullValueAsFile(PATH_HOME);
d = new File(homeDir, path);
- LOG.trace("Overriding property {} from relative path '{}' to absolute path '{}'", path, d.getAbsolutePath());
+ LOG.trace("Overriding property {} from relative path '{}' to absolute path '{}'", propKey, path, d.getAbsolutePath());
props.set(propKey, d.getAbsolutePath());
}
return d;
this.name = name;
this.start = System.currentTimeMillis();
if (debug) {
- logger.debug("%s ...", name);
+ logger.debug("{} ...", name);
} else {
logger.info("{}...", name);
}
public void testBasicProfiling() {
TimeProfiler profiler = new TimeProfiler(logger);
profiler.start("Cycle analysis");
- verify(logger).info("Cycle analysis...");
+ verify(logger).info(eq("{}..."), eq("Cycle analysis"));
profiler.stop();
verify(logger).info(eq("{} done: {} ms"), eq("Cycle analysis"), anyInt());
profiler.stop();
profiler.stop();
profiler.stop();
- verify(logger, times(1)).info(anyString()); // start() executes log() with 1 parameter
+ verify(logger, times(1)).info(anyString(), anyString()); // start() executes log() with 1 parameter
verify(logger, times(1)).info(anyString(), anyString(), anyInt()); // stop() executes log() with 3 parameters
}