Class LoggingService
-
- All Implemented Interfaces:
public final class LoggingService extends MobileService
Represents the service to handle log related task.
-
-
Field Summary
Fields Modifier and Type Field Description private LogPolicy
policy
private Boolean
logToConsole
private Boolean
autoUpload
private LogUploadType
autoUploadType
private Application
application
private String
apiKey
-
Constructor Summary
Constructors Constructor Description LoggingService(Boolean autoUpload, LogUploadType autoUploadType)
LoggingService(Boolean autoUpload)
LoggingService()
-
Method Summary
Modifier and Type Method Description final LogPolicy
getPolicy()
The log policy final Unit
setPolicy(LogPolicy policy)
The log policy final Boolean
getLogToConsole()
Whether log information to the logcat console final Unit
setLogToConsole(Boolean logToConsole)
Whether log information to the logcat console final Boolean
getAutoUpload()
final Unit
setAutoUpload(Boolean autoUpload)
final LogUploadType
getAutoUploadType()
final Unit
setAutoUploadType(LogUploadType autoUploadType)
Unit
init(Application application, String apiKey)
Initializes the mobile service Unit
onStateChange(ApplicationState state)
Notified when application state changes. Unit
reset()
Resets the mobile service to the state that just initialized. final Job
export(ServiceListener<File> listener)
Exports the log in the returned file. final Job
upload(LifecycleOwner owner, LogUploadType uploadType, ServiceListener<Boolean> listener, Function1<Integer, Unit> progressReporter)
Uploads the log. final Job
upload(LifecycleOwner owner, LogUploadType uploadType, ServiceListener<Boolean> listener)
Uploads the log. final Job
upload(LifecycleOwner owner, LogUploadType uploadType)
Uploads the log. final Job
upload(LifecycleOwner owner)
Uploads the log. final Job
upload()
Uploads the log. -
Methods inherited from class com.sap.cloud.mobile.foundation.mobileservices.MobileService
enableNetworkPolicy, getApiKey, getApplication, isApplicationInitialized, mayStartNewProcess, setApiKey, setApplication
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
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
-
getAutoUpload
final Boolean getAutoUpload()
-
setAutoUpload
final Unit setAutoUpload(Boolean autoUpload)
-
getAutoUploadType
final LogUploadType getAutoUploadType()
-
setAutoUploadType
final Unit setAutoUploadType(LogUploadType autoUploadType)
-
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.
-
export
final Job export(ServiceListener<File> listener)
Exports the log in the returned file.
-
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.
-
-
-
-