Skip to content

[FEATURE] @Log(fieldName) #4008

@RamAnvesh

Description

@RamAnvesh

I checked the Wiki to see if this is a duplciate but to me, the wiki seems empty. Apologies if this is a duplicate.

Describe the feature
I would like to be able to select the variable name of the static final log variable.
@Log(fieldName="_log")
@Slf4j(fieldName="_log")
While it is possible to configure this using lombok.config as mentioned here, I would like to do this at the class level.

Describe the target audience
We have a code generator which leverages lombok's ability to generate the log variable. It being a code generator, it also relies on user defined variables to generate variables in the generated class. But if a user defines a variable named "log" it clashes with the lombok generated variable. We have already disallowed users from defining variables with _ as a prefix. This allows the platform to define platform-owned variables with _ and avoiding clashes. It would help if lombok allows us to rename the variable as _log. Using lombok.config changes the behaviour across directories/packages. But we want the code generated class to have isolated behaviour

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions