Logger
This tool provides the engineâs logger and a listener for logs sent from a running Minecraft instance.
Exports
Section titled âExportsâcauldronLogger
Section titled âcauldronLoggerâA consola instance used for all engine output (info, warn, error, debug,
etc.).
const { cauldronLogger } = require('@jackcooperdev/cauldronengine/logger');
cauldronLogger.info('Hello from Cauldron');Functions
Section titled âFunctionsâstartMCListening ()
Section titled âstartMCListening ()âStarts a TCP server on 127.0.0.1:9500 that receives log output from Minecraft (sent by the injected logging config,
or by legacy logging for versions without one) and prints it with the
matching log level.
The function resolves true when the game disconnects and rejects if the server cannot start (for example, if the port
is already in use).
attachLoggerSession (id)
Section titled âattachLoggerSession (id)âIt takes the parameter:
id: Session ID returned by startGame
Associates the logger with a session.
