This module provides a logging utility for different log levels in a game or application. It defines constants for various log levels such as Master, Slave, and Action. The `log` function allows logging messages at specified levels, filtering out messages that do not match the provided log level.
Properties
NameTypeDescription
LOG_LEVELSObjectAn object containing constants for each log level.
Properties
NameTypeDescription
MASTERstringRepresents the master log level.
SLAVEstringRepresents the slave log level.
ACTIONstringRepresents the action log level.
Example
// Example usage:
import { log, LOG_LEVELS } from './log';
log([LOG_LEVELS.MASTER, LOG_LEVELS.SLAVE], LOG_LEVELS.MASTER, "This is a master log message.");
log([LOG_LEVELS.SLAVE], LOG_LEVELS.SLAVE, "This is a slave log message.");
log([LOG_LEVELS.ACTION], LOG_LEVELS.ACTION, "This is an action log message.");

Methods

(static) log(levelArray, logLevel, …args) → {void}

This function checks if the provided log level exists in the levelArray. If it does, it logs the messages to the console with the specified log level prefix. The log messages are formatted with the log level in square brackets followed by the message. This is useful for filtering log messages based on their importance or category.
Parameters:
NameTypeAttributesDescription
levelArrayArray.<string>An array of log levels to filter the messages.
logLevelstringThe log level to check against the levelArray.
argsany<repeatable>
The messages to log. These can be any type of data that can be logged to the console.
Returns:
Type: 
void