Class LogService
-
- All Implemented Interfaces:
@Deprecated() public class LogService extends MobileService
Log service is responsible for initializing logging facility.
-
-
Field Summary
Fields Modifier and Type Field Description public final static MobileService.CompanionCompanionpublic final static StringPERQUISITE_READY_ERROR_MSGpublic Applicationapplicationpublic StringapiKey
-
Constructor Summary
Constructors Constructor Description LogService()
-
Method Summary
Modifier and Type Method Description static LogServicegetInstance()voidinit(@NonNull() Application application, @Nullable() String apiKey)Initializes the mobile service voidonStateChange(@NonNull() ApplicationState state)Notified when application state changes. voidenableNetworkPolicy(@Nullable() NetworkPolicy policy)Enable and set network policy for mobile service. LogServicesetAutoUpload(boolean autoUploadEnabled)Specifies whether auto upload will be used. LogServicesetLogPolicy(@NonNull() LogPolicy logPolicy)Sets logging configurations by LogPolicy.LogServicesetLogConfiguration(@Nullable() Logging.ConfigurationBuilder builder)Sets logging configurations by Logging.ConfigurationBuilder.voidreset()Resets the mobile service to the state that just initialized. static booleanisInitialized()Returns whether the logger has been initialized, and it has not been reset since then. -
Methods inherited from class com.sap.cloud.mobile.foundation.mobileservices.MobileService
getApiKey, getApplication, isApplicationInitialized, mayStartNewProcess, setApiKey, setApplication -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getInstance
@Deprecated()@NonNull() static LogService getInstance()
-
init
void init(@NonNull() Application application, @Nullable() String apiKey)
Initializes the mobile service
-
onStateChange
void onStateChange(@NonNull() ApplicationState state)
Notified when application state changes. This function will be called on Main thread.
-
enableNetworkPolicy
void enableNetworkPolicy(@Nullable() NetworkPolicy policy)
Enable and set network policy for mobile service.
-
setAutoUpload
@NonNull() LogService setAutoUpload(boolean autoUploadEnabled)
Specifies whether auto upload will be used.
- Parameters:
autoUploadEnabled-trueto use auto upload,falseotherwise.
-
setLogPolicy
@NonNull() LogService setLogPolicy(@NonNull() LogPolicy logPolicy)
Sets logging configurations by
LogPolicy.- Parameters:
logPolicy- log policy from server or user defined- Returns:
the log service
-
setLogConfiguration
@NonNull() LogService setLogConfiguration(@Nullable() Logging.ConfigurationBuilder builder)
Sets logging configurations by
Logging.ConfigurationBuilder. IfLogServiceis initialized by application context, then configs the logging. Otherwise, saves the configuration builder object and configs the logging later.- Parameters:
builder- configuration builder to set logging configurations- Returns:
the log service
-
reset
void reset()
Resets the mobile service to the state that just initialized.
-
isInitialized
static boolean isInitialized()
Returns whether the logger has been initialized, and it has not been reset since then.
-
-
-
-