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 LogPolicypolicyprivate BooleanlogToConsoleprivate BooleanautoUploadprivate LogUploadTypeautoUploadTypeprivate Applicationapplicationprivate StringapiKey
-
Constructor Summary
Constructors Constructor Description LoggingService(Boolean autoUpload, LogUploadType autoUploadType)LoggingService(Boolean autoUpload)LoggingService()
-
Method Summary
Modifier and Type Method Description final LogPolicygetPolicy()The log policy final UnitsetPolicy(LogPolicy policy)The log policy final BooleangetLogToConsole()Whether log information to the logcat console final UnitsetLogToConsole(Boolean logToConsole)Whether log information to the logcat console final BooleangetAutoUpload()final UnitsetAutoUpload(Boolean autoUpload)final LogUploadTypegetAutoUploadType()final UnitsetAutoUploadType(LogUploadType autoUploadType)Unitinit(Application application, String apiKey)Initializes the mobile service UnitonStateChange(ApplicationState state)Notified when application state changes. Unitreset()Resets the mobile service to the state that just initialized. final Jobexport(ServiceListener<File> listener)Exports the log in the returned file. final InputStreamexport()Exports the log in the returned input stream. final Jobupload(LifecycleOwner owner, LogUploadType uploadType, ServiceListener<Boolean> listener, Function1<Integer, Unit> progressReporter)Uploads the log. final Jobupload(LifecycleOwner owner, LogUploadType uploadType, ServiceListener<Boolean> listener)Uploads the log. final Jobupload(LifecycleOwner owner, LogUploadType uploadType)Uploads the log. final Jobupload(LifecycleOwner owner)Uploads the log. final Jobupload()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
@Deprecated(message = "Deprecated since 25.4.0", replaceWith = @ReplaceWith(imports = {}, expression = "export()")) final Job export(ServiceListener<File> listener)Exports the log in the returned file.
-
export
final InputStream export()
Exports the log in the returned input stream.
-
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.
-
-
-
-