* @return The constructor, will never be null.
*/
protected Constructor getConstructorForLoggingLevel(final LoggingLevel loggingLevel) {
Checker.notNull("parameter:loggingLevel", loggingLevel);
Type type = null;
while (true) {
if (LoggingLevel.DEBUG == loggingLevel) {
type = this.getDebugLevelLogger();
break;
}
if (LoggingLevel.INFO == loggingLevel) {
type = this.getInfoLevelLogger();
break;
}
if (LoggingLevel.WARN == loggingLevel) {
type = this.getWarnLevelLogger();
break;
}
if (LoggingLevel.ERROR == loggingLevel) {
type = this.getErrorLevelLogger();
break;
}
if (LoggingLevel.FATAL == loggingLevel) {
type = this.getFatalLevelLogger();
break;
}
if (LoggingLevel.NONE == loggingLevel) {
type = this.getNoneLevelLogger();
break;
}
throw new LoggerFactoryGeneratorException("Unknown logging level " + loggingLevel);
}
// find constructor
return type.getConstructor(Collections.nCopies(1, this.getLogger()));
}