Skip to content

Commit 2c140d5

Browse files
Change Parameter logging to TRACE level and optimize Iterable parameter logging (#377)
* Initial plan * Change Parameter logging from DEBUG to TRACE and optimize Iterable parameter logging Co-authored-by: HidekiSugimoto189 <[email protected]> * Add clarifying comment for Iterable parameter logging Co-authored-by: HidekiSugimoto189 <[email protected]> * Address review feedback: Move parameterLog call and improve test with TestAppender Co-authored-by: HidekiSugimoto189 <[email protected]> * loglevelの確認テストは不要と判断し削除 --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: HidekiSugimoto189 <[email protected]> Co-authored-by: Hideki Sugimoto <[email protected]>
1 parent a0fd7f2 commit 2c140d5

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/main/java/jp/co/future/uroborosql/parameter/Parameter.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,17 +158,14 @@ public int setParameter(final PreparedStatement preparedStatement, final int ind
158158
protected int setInParameter(final PreparedStatement preparedStatement, final int index,
159159
final BindParameterMapperManager parameterMapperManager) throws SQLException {
160160
var parameterIndex = index;
161+
parameterLog(parameterIndex);
161162
if (value instanceof Iterable) {
162163
for (var e : (Iterable<?>) value) {
163164
setParameterObject(preparedStatement, parameterIndex, e, parameterMapperManager);
164-
165-
parameterLog(parameterIndex);
166165
parameterIndex++;
167166
}
168167
} else {
169168
setParameterObject(preparedStatement, parameterIndex, value, parameterMapperManager);
170-
171-
parameterLog(parameterIndex);
172169
parameterIndex++;
173170
}
174171

@@ -181,8 +178,8 @@ protected int setInParameter(final PreparedStatement preparedStatement, final in
181178
* @param index パラメータインデックス
182179
*/
183180
protected void parameterLog(final int index) {
184-
if (SQL_LOG.isDebugEnabled() && !isSuppressParameterLogging()) {
185-
debugWith(SQL_LOG)
181+
if (SQL_LOG.isTraceEnabled() && !isSuppressParameterLogging()) {
182+
traceWith(SQL_LOG)
186183
.setMessage("Set the parameter.[INDEX[{}], {}]")
187184
.addArgument(index)
188185
.addArgument(this)

0 commit comments

Comments
 (0)