Add validation when constructing Http2FrameLogger (#10495)
Motivation: There should be a validation for the input arguments when constructing Http2FrameLogger Modification: Check that the provided arguments are not null Result: Proper validation when constructing Http2FrameLogger
This commit is contained in:
parent
b2e52e98a3
commit
4be9387151
@ -43,20 +43,24 @@ public class Http2FrameLogger extends ChannelHandlerAdapter {
|
||||
private final InternalLogLevel level;
|
||||
|
||||
public Http2FrameLogger(LogLevel level) {
|
||||
this(level.toInternalLevel(), InternalLoggerFactory.getInstance(Http2FrameLogger.class));
|
||||
this(checkAndConvertLevel(level), InternalLoggerFactory.getInstance(Http2FrameLogger.class));
|
||||
}
|
||||
|
||||
public Http2FrameLogger(LogLevel level, String name) {
|
||||
this(level.toInternalLevel(), InternalLoggerFactory.getInstance(name));
|
||||
this(checkAndConvertLevel(level), InternalLoggerFactory.getInstance(checkNotNull(name, "name")));
|
||||
}
|
||||
|
||||
public Http2FrameLogger(LogLevel level, Class<?> clazz) {
|
||||
this(level.toInternalLevel(), InternalLoggerFactory.getInstance(clazz));
|
||||
this(checkAndConvertLevel(level), InternalLoggerFactory.getInstance(checkNotNull(clazz, "clazz")));
|
||||
}
|
||||
|
||||
private Http2FrameLogger(InternalLogLevel level, InternalLogger logger) {
|
||||
this.level = checkNotNull(level, "level");
|
||||
this.logger = checkNotNull(logger, "logger");
|
||||
this.level = level;
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
private static InternalLogLevel checkAndConvertLevel(LogLevel level) {
|
||||
return checkNotNull(level, "level").toInternalLevel();
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user