Closed inb4ohnoes closed 9 years ago
STLog is a macro that calls NSLog in debug. So, in release configuration, it does nothing.
While in debug, STLog is called only once in the whole project, in [STHTTPRequest (STTwitter) twitterRequestWithURLString:]
, in the error block where the developer probably wants to see why the request did not succeed.
So, in my opinion, we should change neither the behaviour of STLog nor comment the call in the error block.
Don't hesitate to reopen the issue if you think we actually should.
I thought that it only logged errors, however it seems to be logging other things as well. I'm not sure if it's a side effect of something I'm doing in my particular project but I'm getting things like
2015-09-29 00:23:07.394 [redacted][6413:1541550] -- <__NSObserver: 0x144650200>
and
2015-09-29 00:23:11.832 [redacted][6413:1541550] -- body: [{"name":"[redacted]","placeType":{"code":7,"name":"Town"},"url":"http:\/\/where.yahooapis.com\/v1\/place\/[redacted]","parentid":[redacted],"country":"United States","woeid":[redacted],"countryCode":"US"}] 2015-09-29 00:23:11.995 [redacted][6413:1541550] -- body: [{"id":648367567019446277,"id_str":"648367567019446277","text":"testing again","sender":{"id":1656380738,"id_str":"1656380738","name":
These don't seem like error to me, and I know that I never use the double dashes to print out any of my own debug information. Additionally, these seem to only appear once in a while. They don't appear reliably. Any ideas?
Edit: the --body ones appear reliably. It's definitely from STLog. The only thing I can think of is the error block is being called inappropriately somehow... It seems to only be stuff from direct messages that are being printed out by STLog,
The -- body:
is definitely from https://github.com/nst/STTwitter/blob/master/STTwitter/STHTTPRequest%2BSTTwitter.m#L74
Although it doesn't look like an error, the response was received with a status >= 400 so it must be considered as en error.
Anyway, you can safely comment this line
// if (sr.responseString) STLog(@"-- body: %@", sr.responseString);
but for now I'll keep the log, as it may help spotting potential issues.
I agree with keeping the log for now. I guess I’m just confused by why direct messages would get a >=400 code on return :P
It seems that STLog is dumping a lot of things into the console. For example, in the twitterRequestWithURLString method in STHTTPRequest, there's a log for responseString that starts with --body: that dumps a huge amount of text into the log whenever that method is called. Might it not be more prudent for STLog to be an opt in thing?