From 6f2d15d22afaf947690d895047a7ea6a9d8bad8c Mon Sep 17 00:00:00 2001 From: "Hoa V. DINH" Date: Wed, 3 Jul 2013 23:14:18 -0400 Subject: Fixed logger --- example/ios/iOS UI Test/iOS UI Test/MasterViewController.m | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'example/ios') diff --git a/example/ios/iOS UI Test/iOS UI Test/MasterViewController.m b/example/ios/iOS UI Test/iOS UI Test/MasterViewController.m index c9866ff8..3e5e4422 100644 --- a/example/ios/iOS UI Test/iOS UI Test/MasterViewController.m +++ b/example/ios/iOS UI Test/iOS UI Test/MasterViewController.m @@ -45,9 +45,16 @@ self.imapSession.username = username; self.imapSession.password = password; self.imapSession.connectionType = MCOConnectionTypeTLS; - + MasterViewController * __weak weakSelf = self; + self.imapSession.connectionLogger = ^(void * connectionID, MCOConnectionLogType type, NSData * data) { + @synchronized(weakSelf) { + if (type != MCOConnectionLogTypeSentPrivate) { + NSLog(@"event logged:%p %i withData: %@", connectionID, type, [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]); + } + } + }; + NSLog(@"checking account"); - __weak MasterViewController *weakSelf = self; self.imapCheckOp = [self.imapSession checkAccountOperation]; [self.imapCheckOp start:^(NSError *error) { MasterViewController *strongSelf = weakSelf; -- cgit v1.2.3