Closed rimadoma closed 6 years ago
Hey @rimadoma,
so I'm using slf4j for that at the moment, not directly System.out/err.println(). I'll investigate how both could be coupled. Does the LogService support string interpolation as slf4j does? (Maybe @ctrueden knows?) I'm asking because slf4j has this very nice optional string interpolation which only gets executed in case you are actually using this log level, which is very useful for debug and trace logging.
@skalarproduktraum at least you can set logging level, and it's also an option the user can set in ImageJ / Fiji from Options > ImageJ2. Messages below the level are not shown.
Logging in SciJava is explained here: https://imagej.net/Logging
The optional scijava-log-slf4j
logging plugin pipes all SciJava log output into SLF4J, so you can feed SciJava logging into the logging framework of your choice via SLF4J that way. (Without this plugin, SciJava logging ultimately ends up on stderr/stdout.)
The SciJava logging framework itself does not support string interpolation.
I think Scenery sticking with SLF4J is probably just fine—no need to switch everything. However, I think the System.out.println
calls to which @rimadoma refers are here in SciView—try git grep System.out
to see them. Since SciView is already built on SciJava, make it makes sense for SciView to use the SJC LogService?
Okay, it's helpful to read issues fully, I was under the impression this was filed with scenery xD
For SciView, it should be fine to use the logging service.
Done
Debug messages should be printed using
LogService.debug(String)
instead ofSystem.out.println(String)
so that they can be hidden.