Carpet

Carpet

2M Downloads

`defaultLoggers` doesn't work with logger with parameters

altrisi opened this issue ยท 0 comments

commented

If a logger has parameters, like counter, there is no way to set it as a default logger in the defaultLoggers rule.

This is because the default logger implementation (used for most if not all carpet loggers with options) checks if the entire string between , is the name of the logger, without considering options.

Set<String> loggingOptions = new HashSet<>(Arrays.asList(CarpetSettings.defaultLoggers.split(",")));
if (loggingOptions.contains(getLogName()))
{
LoggerRegistry.subscribePlayer(playerName, getLogName(), getDefault());
}