Logger

The Logger creates a universal and clean way of displaying both the application logs and Minecraft logs at the same time. It uses the log4js package to achieve this.

Logs are displayed in the application console as well as in a file under ā€œcauldron_engine_logsā€ in the root folder. Additionally, it is broadcast on tcp port 25568 on localhost.

Functions

cauldronLogger

The main function is cauldronLogger, and the following are the different log types.

.info(message)

[2024-09-02T11:39:59.715] [INFO] Cauldron - This is a Info Message

.trace(message)

[2024-09-02T11:39:59.715] [TRACE] Cauldron - This is a Trace Message

.debug(message)

[2024-09-02T11:39:59.715] [DEBUG] Cauldron - This is a Debug Message

.warn(message)

[2024-09-02T11:39:59.715] [WARN] Cauldron - This is a Warning Message

.error(message)

[2024-09-02T11:39:59.715] [ERROR] Cauldron - This is a Error Message

attachLoggerSession (id)

It takes the parameter:

  • id : Session ID

Setting the logger session links the session to the next instance of Minecraft launched. This allows for the session to be automatically destroyed when the game is quit.