disables log

This commit is contained in:
Mariotaku Lee 2016-08-18 21:51:12 +08:00
parent 86758eb1d0
commit 31440720d0
3 changed files with 4 additions and 1 deletions

View File

@ -41,6 +41,7 @@ android {
buildConfigField 'boolean', 'LEAK_CANARY_ENABLED', 'Boolean.parseBoolean("false")'
buildConfigField 'boolean', 'SHOW_CUSTOM_TOKEN_DIALOG', 'Boolean.parseBoolean("false")'
buildConfigField 'boolean', 'HOTMOBI_LOG_ENABLED', 'Boolean.parseBoolean("false")'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

View File

@ -128,6 +128,7 @@ public class HotMobiLogger implements HotMobiConstants {
}
public <T extends LogModel> void log(UserKey accountId, final T event, final PreProcessing<T> preProcessing) {
if (!BuildConfig.HOTMOBI_LOG_ENABLED) return;
mExecutor.execute(new WriteLogTask<>(mApplication, accountId, event, preProcessing));
}
@ -148,6 +149,7 @@ public class HotMobiLogger implements HotMobiConstants {
}
public <T extends LogModel> void logList(List<T> events, UserKey accountId, String type, final PreProcessing<T> preProcessing) {
if (!BuildConfig.HOTMOBI_LOG_ENABLED) return;
mExecutor.execute(new WriteLogTask<>(mApplication, accountId, type, events, preProcessing));
}

View File

@ -55,7 +55,7 @@ public class UploadLogsTask implements Runnable {
@Override
public void run() {
if (!BuildConfig.HOTMOBI_LOG_ENABLED) return;
final SharedPreferences prefs = context.getSharedPreferences(HotMobiConstants.SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
if (prefs.contains(HotMobiConstants.KEY_LAST_UPLOAD_TIME)) {