On IntelliJ, I typically enable the inspection to find hard coded strings in Java projects. However, it can generate lot of false positives due to hard coded strings present in logger statements.
Is there any way in IntelliJ to ignore logger statements from this inspection ?
You can annotate the String parameter of the logger method with the @NonNls annotation. The Hard coded strings inspection will then ignore the strings present in logger calls. To annotate, position the text cursor on a warning and press Alt+Enter and select Annotate parameter 'xxx' as @NonNls.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With