You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed here with @rocketraman, another possibility to solve both the "auto-pollution" of any class with a logger property and the performance hit introduced by getting a cached logger instance could be to provide a KSP-based compiler plugin that auto-generates code for annotated classes.
It could work a bit similar to projects like this which auto-generate extension functions for annotated classes. A difference would be that instead of an extension function a property is generated. As the property is generated at compile-time, it can hard-code the class / logger name, avoiding the need to look up a cached logger for a specific class.
To avoid each instance of a class to get its own logger property, probably some more logic needs to be added to statically add the property to a (dummy) companion object instead.