While using a LogService parameter for logging during the initialize method of an initializable DynamicCommand works just fine, the same cannot be done with a Logger parameter, as it throws a NullPointerException.
I assume the reason for this is the different priorities of LoggerPreprocessor vs. ServicePreprocessor:
|
@Plugin(type = PreprocessorPlugin.class) |
|
public class LoggerPreprocessor extends AbstractPreprocessorPlugin { |
|
@Plugin(type = PreprocessorPlugin.class, priority = 2 * Priority.VERY_HIGH) |
|
public class ServicePreprocessor extends AbstractPreprocessorPlugin { |
... and can likely be solved by increasing the priority of the former. I am unsure though if this might have any unwanted side effects elsewhere.
@ctrueden, @maarzt: if you agree, I'll test and file a pull request.
While using a
LogServiceparameter for logging during theinitializemethod of an initializableDynamicCommandworks just fine, the same cannot be done with aLoggerparameter, as it throws a NullPointerException.I assume the reason for this is the different priorities of
LoggerPreprocessorvs.ServicePreprocessor:scijava-common/src/main/java/org/scijava/module/process/LoggerPreprocessor.java
Lines 47 to 48 in f1f666a
scijava-common/src/main/java/org/scijava/module/process/ServicePreprocessor.java
Lines 62 to 63 in f1f666a
... and can likely be solved by increasing the priority of the former. I am unsure though if this might have any unwanted side effects elsewhere.
@ctrueden, @maarzt: if you agree, I'll test and file a pull request.