diff --git a/README.md b/README.md index 1a90b309b..e47648138 100644 --- a/README.md +++ b/README.md @@ -72,13 +72,16 @@ System.loadLibrary("marsxlog"); final String SDCARD = Environment.getExternalStorageDirectory().getAbsolutePath(); final String logPath = SDCARD + "/marssample/log"; +// this is necessary, or may cash for SIGBUS +final String cachePath = this.getFilesDir() + "/xlog" + //init xlog if (BuildConfig.DEBUG) { - Xlog.appenderOpen(Xlog.LEVEL_DEBUG, Xlog.AppednerModeAsync, "", logPath, "MarsSample"); + Xlog.appenderOpen(Xlog.LEVEL_DEBUG, Xlog.AppednerModeAsync, cachePath, logPath, "MarsSample"); Xlog.setConsoleLogOpen(true); } else { - Xlog.appenderOpen(Xlog.LEVEL_INFO, Xlog.AppednerModeAsync, "", logPath, "MarsSample"); + Xlog.appenderOpen(Xlog.LEVEL_INFO, Xlog.AppednerModeAsync, cachePath, logPath, "MarsSample"); Xlog.setConsoleLogOpen(false); } @@ -359,13 +362,16 @@ System.loadLibrary("marsxlog"); final String SDCARD = Environment.getExternalStorageDirectory().getAbsolutePath(); final String logPath = SDCARD + "/marssample/log"; +// this is necessary, or may cash for SIGBUS +final String cachePath = this.getFilesDir() + "/xlog" + //init xlog if (BuildConfig.DEBUG) { - Xlog.appenderOpen(Xlog.LEVEL_DEBUG, Xlog.AppednerModeAsync, "", logPath, "MarsSample"); + Xlog.appenderOpen(Xlog.LEVEL_DEBUG, Xlog.AppednerModeAsync, cachePath, logPath, "MarsSample"); Xlog.setConsoleLogOpen(true); } else { - Xlog.appenderOpen(Xlog.LEVEL_INFO, Xlog.AppednerModeAsync, "", logPath, "MarsSample"); + Xlog.appenderOpen(Xlog.LEVEL_INFO, Xlog.AppednerModeAsync, cachePath, logPath, "MarsSample"); Xlog.setConsoleLogOpen(false); }