Skip to content

Instantly share code, notes, and snippets.

@adamcmwilson
Created January 22, 2015 20:34
Show Gist options
  • Select an option

  • Save adamcmwilson/24a5c0bef9c20193048d to your computer and use it in GitHub Desktop.

Select an option

Save adamcmwilson/24a5c0bef9c20193048d to your computer and use it in GitHub Desktop.
Bundle Key/Value Debug Logging
import android.os.Bundle;
import com.nuvyyo.android.slipstream.exovideoplayer.BuildConfig;
public class BundleUtils {
public static void logBundleKeys(Bundle args) {
try {
if (BuildConfig.DEBUG)
for (String key : args.keySet()) {
final Object value = args.get(key);
bundleItem(key,
value.toString(),
value.getClass().getSimpleName());
}
} catch (Exception e) {
e.printStackTrace();
}
}
private static void bundleItem(final String key,
final String value,
final String type) {
// TODO: log here...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment