@@ -219,105 +219,54 @@ public static void logDebugAndShowToast(Context context, String message) {
219
219
220
220
221
221
222
- public static void logStackTraceWithMessage (String tag , String message , Throwable throwable , boolean getSuppressed ) {
223
- Logger .logErrorExtended (tag , getMessageAndStackTraceString (message , throwable , getSuppressed ));
224
- }
225
-
226
222
public static void logStackTraceWithMessage (String tag , String message , Throwable throwable ) {
227
- logStackTraceWithMessage (tag , message , throwable , true );
228
- }
229
-
230
- public static void logStackTraceWithMessage (String message , Throwable throwable , boolean getSuppressed ) {
231
- logStackTraceWithMessage (DEFAULT_LOG_TAG , message , throwable , getSuppressed );
223
+ Logger .logErrorExtended (tag , getMessageAndStackTraceString (message , throwable ));
232
224
}
233
225
234
226
public static void logStackTraceWithMessage (String message , Throwable throwable ) {
235
- logStackTraceWithMessage (DEFAULT_LOG_TAG , message , throwable , true );
236
- }
237
-
238
-
239
- public static void logStackTrace (String tag , Throwable throwable , boolean getSuppressed ) {
240
- logStackTraceWithMessage (tag , null , throwable , getSuppressed );
227
+ logStackTraceWithMessage (DEFAULT_LOG_TAG , message , throwable );
241
228
}
242
229
243
230
public static void logStackTrace (String tag , Throwable throwable ) {
244
- logStackTraceWithMessage (tag , null , throwable , true );
245
- }
246
-
247
-
248
- public static void logStackTrace (Throwable throwable , boolean getSuppressed ) {
249
- logStackTraceWithMessage (DEFAULT_LOG_TAG , null , throwable , getSuppressed );
231
+ logStackTraceWithMessage (tag , null , throwable );
250
232
}
251
233
252
234
public static void logStackTrace (Throwable throwable ) {
253
- logStackTraceWithMessage (DEFAULT_LOG_TAG , null , throwable , true );
235
+ logStackTraceWithMessage (DEFAULT_LOG_TAG , null , throwable );
254
236
}
255
237
256
238
257
239
258
- public static void logStackTracesWithMessage (String tag , String message , List <Throwable > throwablesList , boolean getSuppressed ) {
259
- Logger .logErrorExtended (tag , getMessageAndStackTracesString (message , throwablesList , getSuppressed ));
260
- }
261
-
262
240
public static void logStackTracesWithMessage (String tag , String message , List <Throwable > throwablesList ) {
263
- Logger .logErrorExtended (tag , getMessageAndStackTracesString (message , throwablesList , true ));
241
+ Logger .logErrorExtended (tag , getMessageAndStackTracesString (message , throwablesList ));
264
242
}
265
243
266
244
267
245
268
246
public static String getMessageAndStackTraceString (String message , Throwable throwable ) {
269
- return getMessageAndStackTraceString (message , throwable , true );
270
- }
271
-
272
- public static String getMessageAndStackTraceString (String message , Throwable throwable , boolean getSuppressed ) {
273
247
if (message == null && throwable == null )
274
248
return null ;
275
249
else if (message != null && throwable != null )
276
- return message + ":\n " + getStackTraceString (throwable , getSuppressed );
250
+ return message + ":\n " + getStackTraceString (throwable );
277
251
else if (throwable == null )
278
252
return message ;
279
253
else
280
- return getStackTraceString (throwable , getSuppressed );
254
+ return getStackTraceString (throwable );
281
255
}
282
256
283
-
284
-
285
257
public static String getMessageAndStackTracesString (String message , List <Throwable > throwablesList ) {
286
- return getMessageAndStackTracesString (message , throwablesList , true );
287
- }
288
-
289
- public static String getMessageAndStackTracesString (String message , List <Throwable > throwablesList , boolean getSuppressed ) {
290
258
if (message == null && (throwablesList == null || throwablesList .size () == 0 ))
291
259
return null ;
292
260
else if (message != null && (throwablesList != null && throwablesList .size () != 0 ))
293
- return message + ":\n " + getStackTracesString (null , getStackTracesStringArray (throwablesList , getSuppressed ));
261
+ return message + ":\n " + getStackTracesString (null , getStackTracesStringArray (throwablesList ));
294
262
else if (throwablesList == null || throwablesList .size () == 0 )
295
263
return message ;
296
264
else
297
- return getStackTracesString (null , getStackTracesStringArray (throwablesList , getSuppressed ));
265
+ return getStackTracesString (null , getStackTracesStringArray (throwablesList ));
298
266
}
299
267
300
268
301
269
302
- public static String getStackTraceString (Throwable throwable , boolean getSuppressed ) {
303
- if (throwable == null ) return null ;
304
-
305
- StringBuilder stackTraceString = new StringBuilder ();
306
- stackTraceString .append (getStackTraceString (throwable ));
307
-
308
- if (getSuppressed ) {
309
- Throwable [] suppressedThrowablesArray = throwable .getSuppressed ();
310
- if (suppressedThrowablesArray != null && suppressedThrowablesArray .length > 0 ) {
311
- for (Throwable suppressedThrowable : suppressedThrowablesArray ) {
312
- if (suppressedThrowable == null ) continue ;
313
- stackTraceString .append ("\n \n " ).append (getStackTraceString (suppressedThrowable ));
314
- }
315
- }
316
- }
317
-
318
- return stackTraceString .toString ();
319
- }
320
-
321
270
public static String getStackTraceString (Throwable throwable ) {
322
271
if (throwable == null ) return null ;
323
272
@@ -339,25 +288,15 @@ public static String getStackTraceString(Throwable throwable) {
339
288
340
289
341
290
342
- public static String [] getStackTracesStringArray (Throwable throwable , boolean getSuppressed ) {
343
- return getStackTracesStringArray (Collections .singletonList (throwable ), getSuppressed );
344
- }
345
-
346
291
public static String [] getStackTracesStringArray (Throwable throwable ) {
347
- return getStackTracesStringArray (Collections .singletonList (throwable ), true );
292
+ return getStackTracesStringArray (Collections .singletonList (throwable ));
348
293
}
349
294
350
295
public static String [] getStackTracesStringArray (List <Throwable > throwablesList ) {
351
- return getStackTracesStringArray (throwablesList , true );
352
-
353
- }
354
-
355
- public static String [] getStackTracesStringArray (List <Throwable > throwablesList , boolean getSuppressed ) {
356
296
if (throwablesList == null ) return null ;
357
-
358
297
final String [] stackTraceStringArray = new String [throwablesList .size ()];
359
298
for (int i = 0 ; i < throwablesList .size (); i ++) {
360
- stackTraceStringArray [i ] = getStackTraceString (throwablesList .get (i ), getSuppressed );
299
+ stackTraceStringArray [i ] = getStackTraceString (throwablesList .get (i ));
361
300
}
362
301
return stackTraceStringArray ;
363
302
}
@@ -415,7 +354,7 @@ public static String getMultiLineLogStringEntry(String label, Object object, Str
415
354
else
416
355
return label + ": " + def ;
417
356
}
418
-
357
+
419
358
420
359
421
360
public static void showToast (final Context context , final String toastText , boolean longDuration ) {
@@ -444,7 +383,7 @@ public static CharSequence[] getLogLevelLabelsArray(Context context, CharSequenc
444
383
logLevelLabels [i ] = getLogLevelLabel (context , Integer .parseInt (logLevels [i ].toString ()), addDefaultTag );
445
384
}
446
385
447
- return logLevelLabels ;
386
+ return logLevelLabels ;
448
387
}
449
388
450
389
public static String getLogLevelLabel (final Context context , final int logLevel , final boolean addDefaultTag ) {
0 commit comments