HHH-5843 Adding a log.isTraceEnabled call before the actual log call

Not really related to the HQL parsing, but it is also a small logging performance change
This commit is contained in:
Hardy Ferentschik 2011-01-19 10:05:37 +01:00
parent 3bf6625ab1
commit cb7cd71fdf
1 changed files with 10 additions and 8 deletions

View File

@ -78,14 +78,16 @@ public abstract class BasicBinder<J> implements ValueBinder<J> {
st.setNull( index, sqlDescriptor.getSqlType() );
}
else {
log.trace(
String.format(
BIND_MSG_TEMPLATE,
index,
JdbcTypeNameMapper.getTypeName( sqlDescriptor.getSqlType() ),
getJavaDescriptor().extractLoggableRepresentation( value )
)
);
if ( log.isTraceEnabled() ) {
log.trace(
String.format(
BIND_MSG_TEMPLATE,
index,
JdbcTypeNameMapper.getTypeName( sqlDescriptor.getSqlType() ),
getJavaDescriptor().extractLoggableRepresentation( value )
)
);
}
doBind( st, value, index, options );
}
}