Inspectopedia
 
2024.3

Logger initialized with foreign class

Warning
Last modified: 03 December 2024

Reports Logger instances initialized with a class literal other than the class the Logger resides in.

This can happen when copy-pasting from another class. It may result in logging events under an unexpected category and incorrect filtering.

Use the inspection options to specify the logger factory classes and methods recognized by this inspection.

Example:

After the quick-fix is applied: