androidpicassoandroid-buildconfig

Why does Picasso comment that "Do NOT pass BuildConfig.DEBUG"


https://github.com/square/picasso/blob/master/picasso/src/main/java/com/squareup/picasso/Picasso.java#L444

  /**
   * Toggle whether debug logging is enabled.
   * <p>
   * <b>WARNING:</b> Enabling this will result in excessive object allocation. This should be only
   * be used for debugging Picasso behavior. Do NOT pass {@code BuildConfig.DEBUG}.
   */
  @SuppressWarnings("UnusedDeclaration") // Public API.
  public void setLoggingEnabled(boolean enabled) {
    loggingEnabled = enabled;
  }

I'm learning the source of Picasso, and I wonder why can't use BuildConfig.DEBUG

I'm known there are some issues in Eclipse/ADT, but is it still not reliable in Android Studio/Gradle? or some reasons else?


Solution

  • I think you're just not supposed to have it enabled all the time in debug builds. Enable this only if you have some problems with Picasso you want to debug and disable after you've fixed them.