Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Logging in XMPPFramework classes is hard to turn off #40

Closed
robertjpayne opened this Issue Apr 27, 2012 · 4 comments

Comments

Projects
None yet
3 participants

If you use CocoaLumberjack elsewhere in your project it is difficult to turn off XMPP logging without currently going through each file and modifying the log level.

XMPPFramework should not use #if DEBUG to determine its logging but rather an internal #DEFINE.

Owner

robbiehanson commented Apr 28, 2012

Now you can just do this (in XMPPLogging.h):

#define XMPP_LOGGING_ENABLED 0

May I suggest a small amendment:

#ifndef XMPP_LOGGING_ENABLED
#define XMPP_LOGGING_ENABLED 1
#endif

My goal is to not have to modify XMPP framework at all so I can include the framework and do updates against the main repository without having to "patch" in changes every time.

This change would allow you to define it in a .pch header before XMPP is included and override the default

Owner

robbiehanson commented Apr 28, 2012

Great idea!

@robbiehanson robbiehanson reopened this Apr 28, 2012

@robbiehanson robbiehanson added a commit that referenced this issue May 4, 2012

@robbiehanson robbiehanson Making it easier to disable logging throughout the framework without …
…modify repository files. (issue #40)
2d6a5fe

Hi, Robbie Hanson, I used the TurnSocket to transmit file, my server is ejabberd. I test the iChat and Adium can be transmit file. but when I used the iPhone simulator, the "- (void)turnSocketDidFail:(TURNSocket *)sender" was called every times. first, I must set the proxy server array? second, i must use the full JID to receiver name?
there is my code:
NSArray * array = [NSArray arrayWithObjects:@"conference.mini.local",@"pubsub.mini.local", @"vjud.mini.local", nil]; //
[TURNSocket setProxyCandidates: array];
XMPPJID *jid = [XMPPJID jidWithString : @"test2@mini.local/mini" ];
_objTURNSocket = [[TURNSocket alloc] initWithStream:_xmppStream toJID: jid ];
[_objTURNSocket startWithDelegate:self delegateQueue:dispatch_get_main_queue() ];
the proxy servers is when I was send this:
-(BOOL)getProxyServers
{

NSError *error = nil;
NSString *strXML = @"<iq type='get'\
from='test1@mini.local'\
to='mini.local'\
id='server_items'>\
<query xmlns='http://jabber.org/protocol/disco#items'/>\
</iq>" ;
NSXMLElement *qust = [[NSXMLElement alloc] initWithXMLString: strXML error: &error ];
NSLog(@"err :%@", error);
[_xmppStream sendElement:qust];

} and the, I receive the items: @"conference.mini.local",@"pubsub.mini.local", @"vjud.mini.local"

@davidchiles davidchiles pushed a commit to davidchiles/XMPPFramework that referenced this issue Jan 26, 2016

@robbiehanson robbiehanson Adding global flag to disable logging throughout the entire xmpp fram…
…ework (fixes issue #40)
7b00980

@davidchiles davidchiles pushed a commit to davidchiles/XMPPFramework that referenced this issue Jan 26, 2016

@robbiehanson robbiehanson Making it easier to disable logging throughout the framework without …
…modify repository files. (issue #40)
5413b51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment