Skip to content

Introduce setDebugLoggingEnabled API#549

Merged
zugaldia merged 3 commits intomasterfrom
telem-logging
Aug 29, 2017
Merged

Introduce setDebugLoggingEnabled API#549
zugaldia merged 3 commits intomasterfrom
telem-logging

Conversation

@zugaldia
Copy link
Member

This API lets us manually control the verbosity of HTTP requests.

@@ -219,7 +228,7 @@ private void sendEventsWrapped(Vector<Hashtable<String, Object>> events, Callbac
String url = getEventsEndpoint() + "/events/v2?access_token=" + getAccessToken();

// Extra debug in staging mode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is now lying. This is an example of why I'm not a big fan of comments :trollface:


// Extra debug in staging mode
if (isStagingEnvironment()) {
if (isDebugLoggingEnabled()) {
Copy link
Contributor

@Guardiola31337 Guardiola31337 Aug 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zugaldia
If we're going to go this way, we need to change

with MapboxTelemetry#setDebugLoggingEnabled(true) and deprecate/adapt

its getter and its setter

public boolean isStagingEnvironment() {
return stagingEnvironment;
}
public void setStagingEnvironment(boolean stagingEnvironment) {
this.stagingEnvironment = stagingEnvironment;
}

Another possibility is adding || isStagingEnvironment() and not break anything 😉
Right now, we're not logging when in staging mode if we don't set debugLoggingEnabled to true which is not desired because we're not preserving previous functionality.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, let's do || isStagingEnvironment() for now. Fixing up in a bit.

Copy link
Contributor

@Guardiola31337 Guardiola31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The best comment is a good name for a method or class.

or variable in this case 😛
👀 Code Smells 👉 Comments

@zugaldia zugaldia merged commit acdd07b into master Aug 29, 2017
@zugaldia zugaldia deleted the telem-logging branch August 29, 2017 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants