Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 911
Kassadin Avatar asked Mar 04 '26 20:03

Kassadin


1 Answers

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.

like image 96
Marcin Koziński Avatar answered Mar 07 '26 22:03

Marcin Koziński