Class LoggingService

  • All Implemented Interfaces:

    
    public final class LoggingService
    extends MobileService
                        

    Represents the service to handle log related task.

    • Constructor Detail

      • LoggingService

        LoggingService(Boolean autoUpload)
      • LoggingService

        LoggingService()
    • Method Detail

      • getAutoUpload

         final Boolean getAutoUpload()

        Whether logs are uploaded automatically. When true, logs are uploaded in the background without any explicit call to upload. Automatic uploads are triggered when a client policy is retrieved (see onStateChange) and whenever a log file rolls over because it reached its size limit. Automatic uploads only run when log upload is enabled by the active policy; otherwise they are skipped. Defaults to false, meaning logs are uploaded only when upload is called explicitly. Changing this value after the service is initialized re-configures the logging service.

      • setAutoUpload

         final Unit setAutoUpload(Boolean value)

        Whether logs are uploaded automatically. When true, logs are uploaded in the background without any explicit call to upload. Automatic uploads are triggered when a client policy is retrieved (see onStateChange) and whenever a log file rolls over because it reached its size limit. Automatic uploads only run when log upload is enabled by the active policy; otherwise they are skipped. Defaults to false, meaning logs are uploaded only when upload is called explicitly. Changing this value after the service is initialized re-configures the logging service.

      • upload

        @JvmOverloads() final Job upload(LifecycleOwner owner, LogUploadType uploadType, ServiceListener<Boolean> listener, Function1<Integer, Unit> progressReporter)

        Uploads the log.

        Parameters:
        owner - The optional lifecycle owner, either an activity or a fragment.
        uploadType - The optional upload type, please see LogUploadType.
        listener - The optional upload status listener, it will be notified on the main thread.
        progressReporter - The optional file upload progress reporter.
      • upload

        @JvmOverloads() final Job upload(LifecycleOwner owner)

        Uploads the log.

        Parameters:
        owner - The optional lifecycle owner, either an activity or a fragment.