@@ -73,7 +73,7 @@ public DbCommand Generate(CommandType type, SqlString sqlString, SqlType[] param
73
73
74
74
var cmd = _factory . ConnectionProvider . Driver . GenerateCommand ( type , sql , parameterTypes ) ;
75
75
LogOpenPreparedCommand ( ) ;
76
- if ( Log . IsDebugEnabled )
76
+ if ( Log . IsDebugEnabled ( ) )
77
77
{
78
78
Log . Debug ( "Building an DbCommand object for the SqlString: {0}" , sql ) ;
79
79
}
@@ -122,7 +122,7 @@ public virtual DbCommand PrepareBatchCommand(CommandType type, SqlString sql, Sq
122
122
{
123
123
if ( sql . Equals ( _batchCommandSql ) && ArrayHelper . ArrayEquals ( parameterTypes , _batchCommandParameterTypes ) )
124
124
{
125
- if ( Log . IsDebugEnabled )
125
+ if ( Log . IsDebugEnabled ( ) )
126
126
{
127
127
Log . Debug ( "reusing command {0}" , _batchCommand . CommandText ) ;
128
128
}
@@ -190,7 +190,7 @@ public int ExecuteNonQuery(DbCommand cmd)
190
190
LogCommand ( cmd ) ;
191
191
Prepare ( cmd ) ;
192
192
Stopwatch duration = null ;
193
- if ( Log . IsDebugEnabled )
193
+ if ( Log . IsDebugEnabled ( ) )
194
194
duration = Stopwatch . StartNew ( ) ;
195
195
try
196
196
{
@@ -204,7 +204,7 @@ public int ExecuteNonQuery(DbCommand cmd)
204
204
}
205
205
finally
206
206
{
207
- if ( Log . IsDebugEnabled && duration != null )
207
+ if ( Log . IsDebugEnabled ( ) && duration != null )
208
208
Log . Debug ( "ExecuteNonQuery took {0} ms" , duration . ElapsedMilliseconds ) ;
209
209
}
210
210
}
@@ -215,7 +215,7 @@ public virtual DbDataReader ExecuteReader(DbCommand cmd)
215
215
LogCommand ( cmd ) ;
216
216
Prepare ( cmd ) ;
217
217
Stopwatch duration = null ;
218
- if ( Log . IsDebugEnabled )
218
+ if ( Log . IsDebugEnabled ( ) )
219
219
duration = Stopwatch . StartNew ( ) ;
220
220
DbDataReader reader = null ;
221
221
try
@@ -230,7 +230,7 @@ public virtual DbDataReader ExecuteReader(DbCommand cmd)
230
230
}
231
231
finally
232
232
{
233
- if ( Log . IsDebugEnabled && duration != null && reader != null )
233
+ if ( Log . IsDebugEnabled ( ) && duration != null && reader != null )
234
234
{
235
235
Log . Debug ( "ExecuteReader took {0} ms" , duration . ElapsedMilliseconds ) ;
236
236
_readersDuration [ reader ] = duration ;
@@ -388,7 +388,7 @@ private Stopwatch GetReaderStopwatch(DbDataReader reader)
388
388
389
389
private static void LogDuration ( Stopwatch duration )
390
390
{
391
- if ( ! Log . IsDebugEnabled || duration == null ) return ;
391
+ if ( ! Log . IsDebugEnabled ( ) || duration == null ) return ;
392
392
393
393
Log . Debug ( "DataReader was closed after {0} ms" , duration . ElapsedMilliseconds ) ;
394
394
}
@@ -415,11 +415,11 @@ public void ExecuteBatch()
415
415
protected void ExecuteBatchWithTiming ( DbCommand ps )
416
416
{
417
417
Stopwatch duration = null ;
418
- if ( Log . IsDebugEnabled )
418
+ if ( Log . IsDebugEnabled ( ) )
419
419
duration = Stopwatch . StartNew ( ) ;
420
420
var countBeforeExecutingBatch = CountOfStatementsInCurrentBatch ;
421
421
DoExecuteBatch ( ps ) ;
422
- if ( Log . IsDebugEnabled && duration != null )
422
+ if ( Log . IsDebugEnabled ( ) && duration != null )
423
423
Log . Debug ( "ExecuteBatch for {0} statements took {1} ms" ,
424
424
countBeforeExecutingBatch ,
425
425
duration . ElapsedMilliseconds ) ;
@@ -478,7 +478,7 @@ protected void LogCommand(DbCommand command)
478
478
479
479
private void LogOpenPreparedCommand ( )
480
480
{
481
- if ( Log . IsDebugEnabled )
481
+ if ( Log . IsDebugEnabled ( ) )
482
482
{
483
483
int currentOpenCommandCount = Interlocked . Increment ( ref _openCommandCount ) ;
484
484
Log . Debug ( "Opened new DbCommand, open DbCommands: {0}" , currentOpenCommandCount ) ;
@@ -492,7 +492,7 @@ private void LogOpenPreparedCommand()
492
492
493
493
private void LogClosePreparedCommand ( )
494
494
{
495
- if ( Log . IsDebugEnabled )
495
+ if ( Log . IsDebugEnabled ( ) )
496
496
{
497
497
int currentOpenCommandCount = Interlocked . Decrement ( ref _openCommandCount ) ;
498
498
Log . Debug ( "Closed DbCommand, open DbCommands: {0}" , currentOpenCommandCount ) ;
@@ -506,7 +506,7 @@ private void LogClosePreparedCommand()
506
506
507
507
private static void LogOpenReader ( )
508
508
{
509
- if ( Log . IsDebugEnabled )
509
+ if ( Log . IsDebugEnabled ( ) )
510
510
{
511
511
int currentOpenReaderCount = Interlocked . Increment ( ref _openReaderCount ) ;
512
512
Log . Debug ( "Opened DbDataReader, open DbDataReaders: {0}" , currentOpenReaderCount ) ;
@@ -515,7 +515,7 @@ private static void LogOpenReader()
515
515
516
516
private static void LogCloseReader ( )
517
517
{
518
- if ( Log . IsDebugEnabled )
518
+ if ( Log . IsDebugEnabled ( ) )
519
519
{
520
520
int currentOpenReaderCount = Interlocked . Decrement ( ref _openReaderCount ) ;
521
521
Log . Debug ( "Closed DbDataReader, open DbDataReaders :{0}" , currentOpenReaderCount ) ;
0 commit comments