Skip to content

Commit 0fd0e29

Browse files
committed
ServiceHelper: report new services only in debug
The plethora of INFO messages every time a new context is created are rather overwhelming, especially during unit testing when a new context is spun up for each and every test. This change will greatly decrease the amount of traffic on the console under normal circumstances. The service creation messages are still easily available by first setting: System.setProperty("scijava.log.level:org.scijava.service", "debug"); With such a property set, the ServiceHelper will emit messages at debug level without infecting the entire JVM with debug level messages.
1 parent cd0d014 commit 0fd0e29

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main/java/org/scijava/service/ServiceHelper.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,9 @@ private <S extends Service> S createExactService(final Class<S> c,
243243
if (debug) start = System.currentTimeMillis();
244244
final S service = createServiceRecursively(c);
245245
context().getServiceIndex().add(service);
246-
if (debug) end = System.currentTimeMillis();
247-
log.info("Created service: " + name);
248246
if (debug) {
249-
log.debug("\t[" + name + " created in " + (end - start) + " ms]");
247+
end = System.currentTimeMillis();
248+
log.debug("Created service '" + name + "' in " + (end - start) + " ms");
250249
}
251250
return service;
252251
}

0 commit comments

Comments
 (0)