From 1e076ea63d776f76c36934669545c7e4f2ec6838 Mon Sep 17 00:00:00 2001 From: Stypox Date: Sat, 18 Jun 2022 18:09:12 +0200 Subject: [PATCH] Wrap debug log in if(DEBUG) --- .../org/schabi/newpipe/player/helper/PlayerDataSource.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/helper/PlayerDataSource.java b/app/src/main/java/org/schabi/newpipe/player/helper/PlayerDataSource.java index 82fb3a0e7..88f25e194 100644 --- a/app/src/main/java/org/schabi/newpipe/player/helper/PlayerDataSource.java +++ b/app/src/main/java/org/schabi/newpipe/player/helper/PlayerDataSource.java @@ -1,5 +1,7 @@ package org.schabi.newpipe.player.helper; +import static org.schabi.newpipe.MainActivity.DEBUG; + import android.content.Context; import android.util.Log; @@ -199,7 +201,9 @@ public class PlayerDataSource { private static void instantiateCacheIfNeeded(final Context context) { if (cache == null) { final File cacheDir = new File(context.getExternalCacheDir(), CACHE_FOLDER_NAME); - Log.d(TAG, "instantiateCacheIfNeeded: cacheDir = " + cacheDir.getAbsolutePath()); + if (DEBUG) { + Log.d(TAG, "instantiateCacheIfNeeded: cacheDir = " + cacheDir.getAbsolutePath()); + } if (!cacheDir.exists() && !cacheDir.mkdir()) { Log.w(TAG, "instantiateCacheIfNeeded: could not create cache dir"); }