2013-12-09 2 views
3

내 물건을 놓치고 싶지만 로깅 출력을받지 못하면 사과드립니다. XMPPFramework에서 로깅 출력이 없습니다. 코코아포드를 통해 설치되었습니다.

내가 Cocoapods에서 XMPPFramework를 설치

..

이 내가 프레임 워크 및 설치 엑스 코드 (V 5.0.2)을 설치하는 데 걸린 단계입니다.

1.Podfile :

platform :ios, '7.0' 
pod 'XMPPFramework', '~> 3.6.3' 

설치 2.pod

Output: 

Analyzing dependencies 
Downloading dependencies 
Installing CocoaAsyncSocket (7.3.2) 
Installing CocoaLumberjack (1.6.5.1) 
Installing XMPPFramework (3.6.3) 
Generating Pods project 
Integrating client project 

[!] From now on use `XMPPFramworkTemplate.xcworkspace`. 
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message. 

3.AppDelegate.h

#import <DDLog.h> 
#import <DDTTYLogger.h> 
#import <DDASLLogger.h> 

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
    { 
     // Override point for customization after application launch. 

     [DDLog addLogger:[DDASLLogger sharedInstance]]; 
     [DDLog addLogger:[DDTTYLogger sharedInstance]]; 
      return YES; 
    } 

4.ViewController.m

#import <XMPPFramework.h> 
#import <DDLog.h> 
#import <DDTTYLogger.h> 
#import <DDASLLogger.h> 

static const int ddLogLevel = LOG_LEVEL_VERBOSE; 

@interface ViewController() 
@property (strong, nonatomic) XMPPStream *xmppStream; 
@end 

@implementation ViewController 

- (void)viewDidLoad 
{ 
    [super viewDidLoad]; 
    // Do any additional setup after loading the view, typically from a nib. 

    //This works.... 
    DDLogVerbose(@"%@: %@", THIS_FILE, THIS_METHOD); 

    //Testing 
    [[self xmppStream] setMyJID:[ XMPPJID jidWithString:@"[email protected]"]]; 

    //Testing 
    NSError *error = nil; 
    [[self xmppStream] connectWithTimeout:XMPPStreamTimeoutNone error:&error]; 
} 

... 
,

5.Console 출력 :

2013-12-07 12:54:46:449 XMPPFramworkTemplate[43458:70b] ViewController: viewDidLoad 

그래서 로깅은의 ViewController에서 노력하고 있지만 XMPPFramework에서 출력 아무것도하지 않는 것 같습니다.

XMPPLogSend가 실행되지 않는 것처럼 보입니다. 그래서 만약 내가 sendOpeningNegotiation에 중단 점을 추가, 그래서 그냥 내가 아주 새로운 목표 - C에 오전주의로

NSString *s1 = @"<?xml version='1.0'?>"; 

NSData *outgoingData = [s1 dataUsingEncoding:NSUTF8StringEncoding]; 

XMPPLogSend(@"SEND: %@", s1); 
numberOfBytesSent += [outgoingData length]; 
..... 

의 출력을 기다리고 있었다/엑스 코드 등 내가 놓친 게 분명 뭔가가, 알려 주시기 바랍니다 나도 알아.

아이디어가 있으십니까?

감사합니다.

답변

1

으로는이

#if DEBUG 
    const int ddLogLevel = (LOG_LEVEL_VERBOSE | XMPP_LOG_FLAG_SEND); 
#else 
    const int ddLogLevel = LOG_LEVEL_INFO; 
#endif 

@implementation AppDelegate 

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 

    [DDLog addLogger:[DDTTYLogger sharedInstance] withLogLevel:ddLogLevel]; 

    return YES; 
} 
를 사용하여 매크로 XMPPLogSend 다시 로그온 얻을 수있는 here on github 언급