问题描述:

I am using pkyeck / socket.IO-objc framework. It is very good, however I am unable to debug with the verbose logs it produces to the lldb, which makes the console constantly full with descriptions about traffic, which are useless to me at the moment. I couldn't find a way how to turn it OFF. Anybody knows how to do it? I just can't imagine myself commenting out all the lines with NSLog...

网友答案:

Found the solution. It is rather undesired to tinker with the source code of the framework - usually it is a good practice to take it AS-IS but since there wasn't any other way...

In the file SocketIO.m, locate line numbers 32 - 39:

#define DEBUG_LOGS 1
#define DEBUG_CERTIFICATE 1

#if DEBUG_LOGS
#define DEBUGLOG(...) NSLog(__VA_ARGS__)
#else
#define DEBUGLOG(...) 
#endif

Naturally, everybody now knows what comes next - change the value of DEBUG_LOGS to 0.

That's it, done. I recommend adding a //TODO: to the line above in order not to forget for the next time, when debugging logs are desired.

相关阅读:
Top