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 BooleanautoUploadprivate LogUploadTypeautoUploadTypeprivate LogPolicypolicyprivate BooleanlogToConsole
-
Constructor Summary
Constructors Constructor Description LoggingService(Boolean autoUpload, LogUploadType autoUploadType)LoggingService(Boolean autoUpload)LoggingService()
-
Method Summary
Modifier and Type Method Description final BooleangetAutoUpload()final UnitsetAutoUpload(Boolean value)final LogUploadTypegetAutoUploadType()final UnitsetAutoUploadType(LogUploadType value)final LogPolicygetPolicy()The log policy final UnitsetPolicy(LogPolicy <set-?>)The log policy final BooleangetLogToConsole()Whether log information to the logcat console final UnitsetLogToConsole(Boolean <set-?>)Whether log information to the logcat console 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. -
-
Constructor Detail
-
LoggingService
LoggingService(Boolean autoUpload, LogUploadType autoUploadType)
-
LoggingService
LoggingService(Boolean autoUpload)
-
LoggingService
LoggingService()
-
-
Method Detail
-
getAutoUpload
final Boolean getAutoUpload()
-
setAutoUpload
final Unit setAutoUpload(Boolean value)
-
getAutoUploadType
final LogUploadType getAutoUploadType()
-
setAutoUploadType
final Unit setAutoUploadType(LogUploadType value)
-
getLogToConsole
final Boolean getLogToConsole()
Whether log information to the logcat console
-
setLogToConsole
final Unit setLogToConsole(Boolean <set-?>)
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.
-
export
@Deprecated(message = "Deprecated since 25.4.0", replaceWith = @ReplaceWith(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.
-
-
-
-