소스 검색

Merge pull request #126 from inamiy/traceExecution

NSLog data-bytes instead of data-self when traceExecution=YES.
August "Gus" Mueller 12 년 전
부모
커밋
3a56feb0e0
1개의 변경된 파일12개의 추가작업 그리고 2개의 파일을 삭제
  1. 12 2
      src/FMDatabase.m

+ 12 - 2
src/FMDatabase.m

@@ -673,7 +673,12 @@ - (FMResultSet *)executeQuery:(NSString *)sql withArgumentsInArray:(NSArray*)arr
             }
             
             if (_traceExecution) {
-                NSLog(@"obj: %@", obj);
+                if ([obj isKindOfClass:[NSData class]]) {
+                    NSLog(@"data: %d byte", [(NSData*)obj length]);
+                }
+                else {
+                    NSLog(@"obj: %@", obj);
+                }
             }
             
             idx++;
@@ -858,7 +863,12 @@ - (BOOL)executeUpdate:(NSString*)sql error:(NSError**)outErr withArgumentsInArra
             }
             
             if (_traceExecution) {
-                NSLog(@"obj: %@", obj);
+                if ([obj isKindOfClass:[NSData class]]) {
+                    NSLog(@"data: %d byte", [(NSData*)obj length]);
+                }
+                else {
+                    NSLog(@"obj: %@", obj);
+                }
             }
             
             idx++;