Class Log
Each logging method preprocesses text by parsing language/placeholders via
ValorlessUtils.getLang() and converting Minecraft formatting to ANSI
with McToAnsi.convert(String) before delegating to
Logger.getLogger(String).
This class provides convenience wrappers for info, warning, error, and
debug logging. Debug logging is controlled per plugin through
config.yml using the debug boolean key.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidLogs a debug message when the plugin hasdebug: trueinconfig.yml.static voidLogs an error message for the calling plugin.static voidLogs an informational message for the calling plugin.static voidLogs a warning message for the calling plugin.
-
Constructor Details
-
Log
public Log()
-
-
Method Details
-
info
Logs an informational message for the calling plugin.The message is parsed using the shared language parser and then converted to ANSI before being emitted at
Level.INFO.- Parameters:
caller- the plugin sending the logmsg- the message to write
-
warning
Logs a warning message for the calling plugin.The message is parsed using the shared language parser and then converted to ANSI before being emitted at
Level.WARNING.- Parameters:
caller- the plugin sending the logmsg- the message to write
-
error
Logs an error message for the calling plugin.The message is parsed using the shared language parser and then converted to ANSI before being emitted at
Level.SEVERE.- Parameters:
caller- the plugin sending the logmsg- the message to write
-
debug
Logs a debug message when the plugin hasdebug: trueinconfig.yml.On first use per plugin, this method loads and caches a
Configforconfig.yml. If the file cannot be loaded, the method exits quietly without logging.When
debugis enabled, the message is parsed and converted to ANSI before being emitted atLevel.WARNINGwith a[DEBUG]prefix.This method uses
Config.getBool(String)to evaluate the debug toggle.- Parameters:
caller- the plugin sending the logmsg- the debug message to write
-