Skip to content

Commit

Permalink
VideoCache 增加日志开关
Browse files Browse the repository at this point in the history
  • Loading branch information
Doikki committed Jul 31, 2021
1 parent aec0b36 commit 7696af0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 0 additions & 2 deletions dkplayer-sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"
android:requestLegacyExternalStorage="true"
android:allowNativeHeapPointerTagging="true"
tools:ignore="LockedOrientationActivity">

<!--允许绘制到oppo、vivo刘海屏机型的刘海区域 -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import androidx.multidex.MultiDexApplication;

import com.danikula.videocache.Logger;

import xyz.doikki.videoplayer.BuildConfig;
import xyz.doikki.videoplayer.ijk.IjkPlayerFactory;
import xyz.doikki.videoplayer.player.VideoViewConfig;
Expand Down Expand Up @@ -49,6 +51,9 @@ public void onCreate() {
// StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build());
// StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll().penaltyLog().build());
// }

// VideoCache 日志
Logger.setDebug(BuildConfig.DEBUG);
}

public static MyApplication getInstance() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ public final class Logger {

private static boolean IS_DEBUG = false;

public static void setDebug(boolean isDebug) {
IS_DEBUG = isDebug;
}

public static void debug(String msg) {
if (IS_DEBUG) {
Log.d(TAG, msg);
Expand Down

0 comments on commit 7696af0

Please sign in to comment.