Closed haithngnbak closed 10 years ago
Do you have the DEBUG Preprocessor Macro?
Hi,
I might be able to add to this - I've been seeing the same sort of issue, i.e. no output from XMPPLogSend(@"SEND: %@", s1).
The problem seems to be that the logFlag for XMPP_LOG_FLAG_SEND is always higher than the logLevel in
So the log messages are skipped.
I'll try to explain...
In my XMPPStream.m I have defined:
static const int xmppLogLevel = XMPP_LOG_FLAG_SEND; // | XMPP_LOG_FLAG_TRACE;
static const int xmppLogLevel = XMPP_LOG_LEVEL_WARN;
In XMPPLogging.h, XMPP_LOG_FLAG_SEND is pre-defined as:
In DDLog.m
A logger with a log level of LOG_LEVEL_VERBOSE, which is defined:
And then added via this function:
This gives a total logLevel of 31.
Now in XMPPLogging.h we define XMPPLogSend as:
XMPP_LOG_FLAG_SEND, XMPP_LOG_CONTEXT, format, ##**VA_ARGS**)
Which sends XMPP_LOG_FLAG_SEND which is defined as 32.
So when the below function is called, the logFlag (32) is never greater than the logLevel (31)
Hope that makes sense.
Thanks
Michael
Do you get the logs with the iPhone sample project?
Yes I do - however the code in DDLog.m is different to the version that I use in cocoapods (CocoaLumberjack (1.6.5.1))
Hi, I used default logging flag : // Log levels: off, error, warn, info, verbose
if DEBUG
static const int xmppLogLevel = XMPP_LOG_LEVEL_INFO | XMPP_LOG_FLAG_SEND_RECV | XMPP_LOG_FLAG_VERBOSE; // | XMPP_LOG_FLAG_TRACE;
else
static const int xmppLogLevel = XMPP_LOG_LEVEL_WARN;
endif
but the code bellow did not logging xml string: XMPPLogTrace(); XMPPLogRecvPost(@"RECV: %@", [root compactXMLString]);
Please help me fix this Thanks,