Restructured log levels. Made 'undefined packet' log as debug

This commit is contained in:
Nanit 2022-01-23 12:46:08 +02:00
parent 4bdf856363
commit cb02cc498b
4 changed files with 12 additions and 12 deletions

View File

@ -39,7 +39,7 @@ public class PacketDecoder extends MessageToMessageDecoder<ByteBuf> {
ctx.fireChannelRead(packet);
} else {
Logger.warning("Undefined incoming packet: 0x" + Integer.toHexString(packetId));
Logger.debug("Undefined incoming packet: 0x" + Integer.toHexString(packetId));
}
}

View File

@ -47,7 +47,7 @@ public class PacketEncoder extends MessageToByteEncoder<Packet> {
Logger.debug("Sending %s packet (%d bytes)", packet.toString(), msg.readableBytes());
}
} catch (Exception e) {
Logger.warning("Cannot encode packet 0x%s: %s", Integer.toHexString(packetId), e.getMessage());
Logger.error("Cannot encode packet 0x%s: %s", Integer.toHexString(packetId), e.getMessage());
}
}

View File

@ -59,10 +59,10 @@ public final class Logger {
public enum Level {
INFO ("INFO", 0),
DEBUG ("DEBUG", 1),
ERROR("ERROR", 1),
WARNING("WARNING", 2),
ERROR("ERROR", 3);
INFO ("INFO", 3),
DEBUG ("DEBUG", 4);
private final String display;
private final int index;

View File

@ -85,13 +85,13 @@ infoForwarding:
# Read timeout for connections in milliseconds
readTimeout: 30000
# Define debug level. On release, i recommend to use 0 level, since
# there are many useless for release information about ping, received packets, etc.
# Levels:
# 0 - Display only useful info
# 1 - Display info and some debug
# 2 - Display info and warnings
# 3 - Display info, warnings, errors
# Define log level. On release, I'd recommend to use level 3
# Log levels:
# 0 - Display nothing
# 1 - Display only errors
# 2 - Display errors, warnings
# 3 - Display errors, warnings, info
# 4 - Display errors, warnings, info, debug
debugLevel: 3
# Warning! Do not touch params of this block, if you not completely sure what is this!