Skip to content

Commit d9b2b5d

Browse files
milos1290hborisoff
andauthored
[SDK-68] Improving SDK logging (#408)
* Improving SDK logging * Disable all logging except errors by default * Add support for log levels * Aligning with design doc * Adding OFF level, fixing tests * Additional fixes for tests * Fix unit tests for PowerMock * Fixing docs Co-authored-by: Hristo Borisov <[email protected]>
1 parent 34944d5 commit d9b2b5d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+436
-472
lines changed

AndroidSDKCore/src/main/java/com/leanplum/ActionContext.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public <T> T objectNamed(String name) {
204204
return VarCache.getMergedValueFromComponentArray(
205205
VarCache.getNameComponents(name), args);
206206
} catch (Throwable t) {
207-
Util.handleException(t);
207+
Log.exception(t);
208208
return null;
209209
}
210210
}
@@ -221,7 +221,7 @@ public String stringNamed(String name) {
221221
try {
222222
return fillTemplate(object.toString());
223223
} catch (Throwable t) {
224-
Util.handleException(t);
224+
Log.exception(t);
225225
return object.toString();
226226
}
227227
}
@@ -282,7 +282,7 @@ public InputStream streamNamed(String name) {
282282
}
283283
return stream;
284284
} catch (Throwable t) {
285-
Util.handleException(t);
285+
Log.exception(t);
286286
return null;
287287
}
288288
}
@@ -301,7 +301,7 @@ public boolean booleanNamed(String name) {
301301
}
302302
return convertToBoolean(object.toString());
303303
} catch (Throwable t) {
304-
Util.handleException(t);
304+
Log.exception(t);
305305
return false;
306306
}
307307
}
@@ -334,7 +334,7 @@ public Number numberNamed(String name) {
334334
}
335335
return Double.valueOf(object.toString());
336336
} catch (Throwable t) {
337-
Util.handleException(t);
337+
Log.exception(t);
338338
return 0.0;
339339
}
340340
}
@@ -391,7 +391,7 @@ public void variablesChanged() {
391391
try {
392392
Leanplum.triggerMessageDisplayed(actionContext);
393393
} catch (Throwable t) {
394-
Util.handleException(t);
394+
Log.exception(t);
395395
}
396396
}
397397
});
@@ -401,7 +401,7 @@ public void variablesChanged() {
401401
}
402402
return true;
403403
} catch (Throwable t) {
404-
Util.handleException(t);
404+
Log.exception(t);
405405
}
406406
return false;
407407
}
@@ -525,7 +525,7 @@ public void runTrackedActionNamed(String name) {
525525
}
526526
runActionNamed(name);
527527
} catch (Throwable t) {
528-
Util.handleException(t);
528+
Log.exception(t);
529529
}
530530
Leanplum.countAggregator().incrementCount("run_tracked_action_named");
531531
}
@@ -559,7 +559,7 @@ public void trackMessageEvent(String event, double value, String info,
559559
LeanplumInternal.track(event, value, info, params, requestArgs);
560560
}
561561
} catch (Throwable t) {
562-
Util.handleException(t);
562+
Log.exception(t);
563563
}
564564
}
565565

@@ -575,15 +575,15 @@ public void track(String event, double value, Map<String, Object> params) {
575575
LeanplumInternal.track(event, value, null, params, requestArgs);
576576
}
577577
} catch (Throwable t) {
578-
Util.handleException(t);
578+
Log.exception(t);
579579
}
580580
}
581581

582582
public void muteFutureMessagesOfSameKind() {
583583
try {
584584
ActionManager.getInstance().muteFutureMessagesOfKind(messageId);
585585
} catch (Throwable t) {
586-
Util.handleException(t);
586+
Log.exception(t);
587587
}
588588
}
589589

0 commit comments

Comments
 (0)