A convenient way to manage logging things to the console with colorful prefixes indicating their context.
Each Logger instance stores its context type, context name, and prefix color,
so you can use its log, warn, and error
methods in the same manner that you would use the console methods with the same names. The prefix
will be generated and prepended to the appropriate console message automatically.
If you are only logging a single message with a prefix in your plugin, you may use log, warn, or error
instead of creating a Logger. Otherwise, using this class is much more convenient than specifying
the type, name, and color for every message.
A convenient way to manage logging things to the console with colorful prefixes indicating their context. Each
Logger
instance stores its context type, context name, and prefix color, so you can use its log, warn, and error methods in the same manner that you would use theconsole
methods with the same names. The prefix will be generated and prepended to the appropriate console message automatically.If you are only logging a single message with a prefix in your plugin, you may use log, warn, or error instead of creating a
Logger
. Otherwise, using this class is much more convenient than specifying the type, name, and color for every message.Example usage: