Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes some logs which are killing our sumo usage #2911

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions app/src/org/commcare/activities/CommCareGraphActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,5 @@ protected void onCreate(Bundle savedInstanceState) {
protected void onDestroy() {
super.onDestroy();
FirebaseAnalyticsUtil.reportGraphViewFullScreenClosed();

String title = getTitle() == null || getTitle().length() == 0 ? "(no title)" : getTitle().toString();
Logger.log(LogTypes.TYPE_GRAPHING,
String.format("End viewing full screen graph for %s", title));
}
}
1 change: 0 additions & 1 deletion app/src/org/commcare/android/javarosa/IntentCallout.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ public Intent generate(EvaluationContext ec) {
}
}
}
Logger.log(LogTypes.TYPE_FORM_ENTRY, "Generated intent for callout: " + i.toString());
return i;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ private void publishStatus() {
if (mAppUpdateState == newState) {
return;
}
Logger.log(LogTypes.TYPE_CC_UPDATE, "Publishing status update to : " + newState.name() + ", from : "
+ (mAppUpdateState != null ? mAppUpdateState.name() : "null"));
Comment on lines -164 to -165
Copy link
Contributor

Choose a reason for hiding this comment

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

@shubham1g5 Are we 100% sure that this is unnecessary? We can consider logging when the state changes.

Copy link
Contributor Author

@shubham1g5 shubham1g5 Dec 9, 2024

Choose a reason for hiding this comment

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

This already logs only when state changes (look at the if cond above this). I don't think this gives us any useful debugging info as such as most functionality there is managed by Play services API. Also there is nothing like 100% certainity with what you might and might not need with logs and think we should avoid this framing in deciding what to log. Instead a better framing for retroactively deleting logs is have you found a particular line of useful while solving any debugging issues in past ? Happy to re-consider if so.

Copy link
Contributor

@avazirna avazirna Dec 9, 2024

Choose a reason for hiding this comment

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

Instead a better framing for retroactively deleting logs is have you found a particular line of useful while solving any debugging issues in past ?

Agree, my framing was exactly in this sense, I remember troubleshooting the app update issue and looking at these, but don't remember how useful they actually were.

mAppUpdateState = newState;
mCallback.run();
}
Expand Down
8 changes: 0 additions & 8 deletions app/src/org/commcare/graph/view/GraphView.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,12 @@ public GraphWebView(Context context) {
protected void onAttachedToWindow() {
super.onAttachedToWindow();
FirebaseAnalyticsUtil.reportGraphViewAttached();

String displayTitle = mTitle == null || "".equals(mTitle) ? "(no title)" : mTitle;
Logger.log(LogTypes.TYPE_GRAPHING,
String.format("Start viewing graph in list for %s", displayTitle));
}

@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
FirebaseAnalyticsUtil.reportGraphViewDetached();

String displayTitle = mTitle == null || "".equals(mTitle) ? "(no title)" : mTitle;
Logger.log(LogTypes.TYPE_GRAPHING,
String.format("End viewing graph in list for %s", displayTitle));
}
}

Expand Down
1 change: 0 additions & 1 deletion app/src/org/commcare/preferences/HiddenPreferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ public static int getIdOfInterruptedSSD() {
}

public static void clearInterruptedSSD() {
Logger.log(LogTypes.TYPE_MAINTENANCE, "Clearing interrupted state");
String currentUserId = CommCareApplication.instance().getCurrentUserId();
CommCareApplication.instance().getCurrentApp().getAppPreferences().edit()
.putInt(ID_OF_INTERRUPTED_SSD + currentUserId, -1).apply();
Expand Down
1 change: 0 additions & 1 deletion app/src/org/commcare/tasks/DataPullTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ private ResultAndError<PullTaskResult> doTaskBackgroundHelper() {

publishProgress(PROGRESS_STARTED);
HiddenPreferences.setPostUpdateSyncNeeded(false);
Logger.log(LogTypes.TYPE_USER, "Starting Sync");
determineIfLoginNeeded();

AndroidTransactionParserFactory factory = getTransactionParserFactory();
Expand Down
1 change: 0 additions & 1 deletion app/src/org/commcare/tasks/LogSubmissionTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,6 @@ private LogSubmitOutcomes checkSubmissionResult(int numberOfLogsToSubmit,
if (submittedSuccesfully.size() == numberOfLogsToSubmit) {
return LogSubmitOutcomes.SUBMITTED;
} else {
Logger.log(LogTypes.TYPE_MAINTENANCE, numberOfLogsToSubmit - submittedSuccesfully.size() + " logs remain on phone.");
//Some remain unsent
return LogSubmitOutcomes.SERIALIZED;
}
Expand Down
12 changes: 8 additions & 4 deletions app/src/org/commcare/utils/FormUploadUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,14 @@ private static boolean buildMultipartEntity(List<MultipartBody.Part> parts,
}
}
}
Logger.log(LogTypes.TYPE_FORM_SUBMISSION, "Attempted to add "
+ numAttachmentsInInstanceFolder + " attachments to submission entity");
Logger.log(LogTypes.TYPE_FORM_SUBMISSION, "Successfully added "
+ numAttachmentsSuccessfullyAdded + " attachments to submission entity");
if (numAttachmentsInInstanceFolder > 0) {
Logger.log(LogTypes.TYPE_FORM_SUBMISSION, "Attempted to add "
+ numAttachmentsInInstanceFolder + " attachments to submission entity");
}
if (numAttachmentsSuccessfullyAdded > 0) {
Logger.log(LogTypes.TYPE_FORM_SUBMISSION, "Successfully added "
+ numAttachmentsSuccessfullyAdded + " attachments to submission entity");
}
return true;
}

Expand Down
Loading