Skip to content

Logger parameters can't be used while initializing DynamicCommands #446

Description

@imagejan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions