robbiehanson / XMPPFramework

An XMPP Framework in Objective-C for Mac and iOS
Other
5.91k stars 2.09k forks source link

logging question #424

Open jonasman opened 10 years ago

jonasman commented 10 years ago

Any idea why

    [DDLog addLogger:[DDTTYLogger sharedInstance] withLogLevel:XMPP_LOG_FLAG_SEND_RECV | XMPP_LOG_LEVEL_VERBOSE];
    DDFileLogger * fileLogger = [[DDFileLogger alloc]init];
    fileLogger.rollingFrequency = 60 * 60 * 24 * 5 ; // 5 days
    fileLogger.maximumFileSize  = 0;
    [DDLog addLogger:fileLogger];

This isn't logging the xmpp comm to a file?

ObjColumnist commented 10 years ago

Testing it in the simulator it logs to:

/Users/username/Library/Application Support/iPhone Simulator/7.1-64/Applications/SOME_UUID/Library/Caches/Logs/com.deusty.oss.xmppframework.iPhoneXMPP 2014-08-14 15-07.log

jonasman commented 10 years ago

Not working on a phone

ObjColumnist commented 10 years ago

I just tested on a device and its logs to the same location Library/Caches/Logs

Could it be because you are not running a Debug Build, most of the log statements are not executed if DEBUG isn't present in the pre processor macros:

e.g. XMPPStream

#if DEBUG
  static const int xmppLogLevel = XMPP_LOG_LEVEL_INFO | XMPP_LOG_FLAG_SEND_RECV; // | XMPP_LOG_FLAG_TRACE;
#else
  static const int xmppLogLevel = XMPP_LOG_LEVEL_WARN;
#endif
jonasman commented 10 years ago

Im in debug build!

My logs are logged it is just the send/recv that are not