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, LogUploadType autoUploadType)
      • LoggingService

        LoggingService(Boolean autoUpload)
      • LoggingService

        LoggingService()
    • Method Detail

      • getLogToConsole

         final Boolean getLogToConsole()

        Whether log information to the logcat console

      • setLogToConsole

         final Unit setLogToConsole(Boolean logToConsole)

        Whether log information to the logcat console

      • init

         Unit init(Application application, String apiKey)

        Initializes the mobile service

      • onStateChange

         Unit onStateChange(ApplicationState state)

        Notified when application state changes. This function will be called on Main thread.

      • reset

         Unit reset()

        Resets the mobile service to the state that just initialized.

      • 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, LogUploadType uploadType, ServiceListener<Boolean> listener)

        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.
      • upload

        @JvmOverloads() final Job upload(LifecycleOwner owner, LogUploadType uploadType)

        Uploads the log.

        Parameters:
        owner - The optional lifecycle owner, either an activity or a fragment.
        uploadType - The optional upload type, please see LogUploadType.
      • upload

        @JvmOverloads() final Job upload(LifecycleOwner owner)

        Uploads the log.

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

        @JvmOverloads() final Job upload()

        Uploads the log.