Merge pull request #459 from Project-Cepi/log-class-loader-finalization

Use proper logging to log class loader finalization
This commit is contained in:
TheMode 2021-09-14 01:20:48 +02:00 committed by GitHub
commit 561a10bddc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,8 @@
package net.minestom.server.extras.selfmodification;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
@ -15,6 +18,8 @@ public class MinestomExtensionClassLoader extends HierarchyClassLoader {
*/
private final String mainClassName;
private final Logger logger = LoggerFactory.getLogger(MinestomExtensionClassLoader.class);
public MinestomExtensionClassLoader(String extensionName, String mainClassName, URL[] urls, MinestomRootClassLoader root) {
super(extensionName, urls, root);
this.root = root;
@ -95,7 +100,7 @@ public class MinestomExtensionClassLoader extends HierarchyClassLoader {
@Override
protected void finalize() throws Throwable {
super.finalize();
System.err.println("Class loader "+getName()+" finalized.");
logger.info("Class loader " + getName() + " finalized.");
}
/**