[improvement](log) optimize template function log for performance (#23746)
change log level to debug and use format in template function log for performance.
This commit is contained in:
@ -345,10 +345,12 @@ public class FunctionSet<T> {
|
||||
public Function specializeTemplateFunction(Function templateFunction, Function requestFunction, boolean isVariadic) {
|
||||
try {
|
||||
boolean hasTemplateType = false;
|
||||
LOG.debug("templateFunction signature: " + templateFunction.signatureString()
|
||||
+ " return: " + templateFunction.getReturnType());
|
||||
LOG.debug("requestFunction signature: " + requestFunction.signatureString()
|
||||
+ " return: " + requestFunction.getReturnType());
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("templateFunction signature: {}, return type: {}",
|
||||
templateFunction.signatureString(), templateFunction.getReturnType());
|
||||
LOG.debug("requestFunction signature: {}, return type: {}",
|
||||
requestFunction.signatureString(), requestFunction.getReturnType());
|
||||
}
|
||||
List<Type> newArgTypes = Lists.newArrayList();
|
||||
List<Type> newRetType = Lists.newArrayList();
|
||||
if (isVariadic) {
|
||||
@ -397,12 +399,14 @@ public class FunctionSet<T> {
|
||||
specializedFunction.getReturnType().specializeTemplateType(
|
||||
requestFunction.getReturnType(), specializedTypeMap, true));
|
||||
}
|
||||
LOG.debug("specializedFunction signature: " + specializedFunction.signatureString()
|
||||
+ " return: " + specializedFunction.getReturnType());
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("specializedFunction signature: {}, return type: {}",
|
||||
specializedFunction.signatureString(), specializedFunction.getReturnType());
|
||||
}
|
||||
return hasTemplateType ? specializedFunction : templateFunction;
|
||||
} catch (TypeException e) {
|
||||
if (inited) {
|
||||
LOG.warn("specializeTemplateFunction exception", e);
|
||||
if (inited && LOG.isDebugEnabled()) {
|
||||
LOG.debug("specializeTemplateFunction exception", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user