public interface ClientLogManager
As to which operations require the Android Context
is implementation-dependent. Methods
which require the init()
method to be invoked beforehand should throw an
IllegalStateException
in case the context is absent.
Modifier and Type | Method and Description |
---|---|
java.util.List<ClientLogEntry> |
getLogEntries(ClientLogLevel level)
Deprecated.
In case of a large amount of log entries calling this method
might cause memory issues, use
iterateLogEntries(ClientLogLevel) instead. |
java.util.List<ClientLogEntry> |
getLogEntriesForLogger(java.lang.String ID,
ClientLogLevel level)
Deprecated.
In case of a large amount of log entries calling this method
might cause memory issues, use
iterateLogEntriesForLogger(String, ClientLogLevel) instead. |
ClientLogger |
getLogger(java.lang.String id)
Retrieves a logger associated with the given ID.
|
byte[] |
getRawLogData()
Deprecated.
In case of a large amount of log entries calling this
method might cause memory issues, use
iterateRawLogData() instead. |
java.lang.String |
getSMPCorrelationId()
Returns the correlation ID used by this manager at the moment.
|
void |
init(android.content.Context ctx)
Initializes this manager to use the specified application context.
|
java.util.Iterator<ClientLogEntry> |
iterateLogEntries(ClientLogLevel level)
Retrieves an iterator for all entries with the given level produced during the current session
till the point the API was called.
|
java.util.Iterator<ClientLogEntry> |
iterateLogEntriesForLogger(java.lang.String ID,
ClientLogLevel level)
Retrieves an iterator for all log entries with the given level produced by a specific logger associated with
the given ID during the current session till the point the API was called.
|
java.util.Iterator<java.lang.String> |
iterateRawLogData()
Returns an iterator of log data.
|
void |
setLogDestination(java.util.EnumSet<ClientLogDestination> destinations)
Tells where all logger messages should be output; applied to all active loggers, overrides
settings made via
#setLogDestination(int, String) Accepted values are defined in the
ClientLogDestination enumeration; multiple targets can be set by combining these
values. |
void |
setLogDestination(java.util.EnumSet<ClientLogDestination> destinations,
java.lang.String id)
Tells where all logger messages should be output; applied to the logger associated with the
given ID.
|
void |
setLogLevel(ClientLogLevel level)
Sets the overall log level; applied to all active loggers and it will be the default for
loggers created thereafter.
|
void |
setLogLevel(ClientLogLevel level,
java.lang.String ID)
Sets the log level for the logger associated with the given ID.
|
void |
setRootContextId(java.lang.String id)
Sets the root context id.
|
void |
uploadClientLogs(Uploader uploader,
UploadListener uploadListener)
Uploads current logs to the server using the uploader.
|
boolean |
wipeClientLogs(WipeLogListener wipeLogListener)
Initiates clearing the log entries from the destination that allows such operation (e.g.
|
void init(android.content.Context ctx)
ctx
- the Android application context, must be non-nulljava.lang.IllegalArgumentException
- in case the argument is nullClientLogger getLogger(java.lang.String id)
Note that this API shall not be used to log sensitive data, such as authentication data (passwords, tokens, crypto keys), personal data (user’s name, address, gender, age etc.), or business confidential data (request data). Only necessary metadata about the client program’s execution behavior and not about server behavior and error information shall be written to the log.
id
- logger identifier, must be non-nulljava.lang.IllegalArgumentException
- in case the argument is nulljava.lang.IllegalStateException
- in case init(Context)
was not called and thus there's no Android context to work withvoid setLogLevel(ClientLogLevel level)
If the argument is null then it's reset to the initial value set after instantiation of this manager (=which is the ERROR level).
level
- overall log level, can be nullvoid setLogLevel(ClientLogLevel level, java.lang.String ID)
If the level argument is null then it's reset to the initial value set after instantiation of this manager (=which is the ERROR level). If the ID argument is null then this method does nothing.
level
- log level, can be nullid
- logger identifier, can be nullvoid setLogDestination(java.util.EnumSet<ClientLogDestination> destinations)
#setLogDestination(int, String)
Accepted values are defined in the
ClientLogDestination
enumeration; multiple targets can be set by combining these
values. The value set will be the default for loggers created thereafter.
The null argument is treated as if an empty set was specified.
destinations
- one or more destinations, can be nullvoid setLogDestination(java.util.EnumSet<ClientLogDestination> destinations, java.lang.String id)
ClientLogDestination
enumeration;
multiple targets can be set by combining these values.
The null destinations argument is treated as if an empty set was specified. If the ID argument is null then this method does nothing.
destinations
- one or more destinations, can be nullid
- logger identifier, can be null@Deprecated java.util.List<ClientLogEntry> getLogEntries(ClientLogLevel level)
iterateLogEntries(ClientLogLevel)
instead.
If the log level is null it is treated as if level 'ALL
' were specified.
level
- log level, can be null@Deprecated java.util.List<ClientLogEntry> getLogEntriesForLogger(java.lang.String ID, ClientLogLevel level)
iterateLogEntriesForLogger(String, ClientLogLevel)
instead.
If the logger identifier is null, the iterator will return no element.
If the log level is null it is treated as if level 'ALL
' were specified.
ID
- logger identifier, can be nulllevel
- log level, can be nulljava.util.Iterator<ClientLogEntry> iterateLogEntries(ClientLogLevel level)
If the log level is null it is treated as if level 'ALL
' were
specified.
level
- log level, can be nulljava.util.Iterator<ClientLogEntry> iterateLogEntriesForLogger(java.lang.String ID, ClientLogLevel level)
If the logger identifier is null, the iterator will return no element. If the log level is
null it is treated as if level 'ALL
' were specified.
ID
- logger identifier, can be nulllevel
- log level, can be nullvoid uploadClientLogs(Uploader uploader, UploadListener uploadListener)
uploader
- component doing the uploaduploadListener
- listener for the upload result@Deprecated byte[] getRawLogData()
iterateRawLogData()
instead.java.util.Iterator<java.lang.String> iterateRawLogData()
void setRootContextId(java.lang.String id)
id
- the root context ID, may be nulljava.lang.String getSMPCorrelationId()
boolean wipeClientLogs(WipeLogListener wipeLogListener)
wipeLogListener
- listener to be called when wiping finished, can be null