[Solved] Using SLF4J Logger

I’m quite new to Java development and was wondering how to use the logger. I read the documentation though I don’t quite understand it. I have already imported the dependency jarfile and I am using Intellij IDEA Community Edition. Do I place it in my “Main” class or do I use a separate file? How do I use @Inject? I hope someone could help explain it to me in more detail.:sweat:

When your plugin instance is created, Sponge will examine the class for the @Inject annotations, and insert a reference to the logger object for your plugin. It’s rather “magic” in the sense that you just annotate it, and Sponge takes care of it.

This only works for your main plugin class however, as it’s the only class that sponge directly instantiates / constructs. If you want to use @Inject on your other classes, you will need to look into the Guice documentations on how to inject your own classes, but at this stage I recommend just passing them from your main plugin, or passing an instance of your plugin class, and have a getLogger() method.

Thanks, that really helped me.