Package dev.xdpxi.xdlib.api
Class Logger
java.lang.Object
dev.xdpxi.xdlib.api.Logger
A utility class for logging various log levels using Log4j.
Provides methods for logging messages at different severity levels: debug, info, warn, and error.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic org.apache.logging.log4j.LoggerThe logger instance used for logging messages. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidLogs a message at the DEBUG level.static voidLogs a message at the ERROR level.static voidLogs a message at the INFO level.static voidSets up the logger for a specific package with a custom modID.static voidLogs a message at the WARN level.
-
Field Details
-
LOGGER
public static org.apache.logging.log4j.Logger LOGGERThe logger instance used for logging messages. This is initialized with an empty string as the logger name.
-
-
Constructor Details
-
Logger
public Logger()
-
-
Method Details
-
setup
Sets up the logger for a specific package with a custom modID. This method should be called before any log messages are logged to initialize the logger for the package.- Parameters:
packageName- The name of the package.modID- The mod ID to be used as the logger name.
-
debug
Logs a message at the DEBUG level.- Parameters:
log- The message to be logged.
-
info
Logs a message at the INFO level.- Parameters:
log- The message to be logged.
-
warn
Logs a message at the WARN level.- Parameters:
log- The message to be logged.
-
error
Logs a message at the ERROR level.- Parameters:
log- The message to be logged.
-