Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to log information in Forge?

I'm trying to log into using MinecraftServer.logInfo(), but I get a nosuchmethod exception.

    server.logInfo("Example message");

I'm getting the instance of MinecraftServer in the server starting event.

    MinecraftServer server = event.getServer();
like image 503
Alsan Ali Avatar asked Sep 22 '17 15:09

Alsan Ali


People also ask

How do I log a logger?

The log() method of Logger is used to Log a message. If the logger is currently enabled for the given message level which is passed as parameter then a corresponding LogRecord is created and forwarded to all the registered Output Handler objects.


2 Answers

An option for a fully fledged logger is

Logger logger = LogManager.getLogger(YourMod.MODID);
like image 180
phlaxyr Avatar answered Oct 22 '22 12:10

phlaxyr


I'm pretty sure a simple

System.out.println("Information!");

Should do in forge.

like image 30
086 Avatar answered Oct 22 '22 12:10

086