kimminsung / log4jdbc-remix

Automatically exported from code.google.com/p/log4jdbc-remix
0 stars 0 forks source link

every second query is not logged #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

Class Slf4jSpyLogDelegator

line 250

        for (int i = 0; i < sqls.length; i++)
        {
            sql = sqls[i];
            batchReport.append("\n");
            batchReport.append(Utilities.rightJustify(fieldSize, "" + (++i)));
            batchReport.append(":  ");
            batchReport.append(sql);
        }

you are incrementing "i" two times  in 'for' and 'rightJustify(fieldSize, "" + 
(++i))' so every second query won't be logged

Ohh Man - two bugs in 15 lines of your code :)
waiting for 0.2.6

regards 
Daniel Charczyński

Original issue reported on code.google.com by danielch...@gmail.com on 25 Nov 2011 at 6:23

GoogleCodeExporter commented 9 years ago

Original comment by tim.azzo...@gmail.com on 26 Nov 2011 at 1:59

GoogleCodeExporter commented 9 years ago
Hi Daniel

Thank you for finding the bug and suggesting the solution. I really appreciate 
the feedback.

Its fixed in release 0.2.6 and I have added another unit test that covers 
issues 4,5,6

Enjoy!

Original comment by tim.azzo...@gmail.com on 26 Nov 2011 at 2:05