简体   繁体   中英

hyperlog-android not all logs are send to the server . how to solve this?

File file = 
HyperLog.getDeviceLogsInFile(this);
    HyperLog.setURL("url");
    HyperLog.pushLogs(this, file.getAbsolutePath(), false, new HLCallback() {
        @Override
        public void onSuccess(@NonNull Object response) {

            Log.d("HYPERLOG", "onSuccess: called");
        }

        @Override
        public void onError(@NonNull HLErrorResponse HLErrorResponse) {
            Log.d("HYPERLOG", "onError: called");

  MiscUtilities.sendErrorReportToCrashAnalytics("onErrorCalled"+HLErrorResponse.getErrorCode());
        }
    });`

and I am initializing the hyper logs in my Base Application like this

    HyperLog.initialize(this);
    HyperLog.setLogLevel(Log.VERBOSE);

can anyone tell me what's wrong I am doing here ??

Due to below statement logs are already written to file so after this statement if you call pushLogs() API then no logs will be available to push. File file = HyperLog.getDeviceLogsInFile(this);

Otherwise call File file = HyperLog.getDeviceLogsInFile(this,false); so on file write it will not delete logs from DB and call to pushLogs() will push logs to server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM