public class LocalLogSession extends java.lang.Object implements ILogSession
LogSession, it does not keep the application data.
The local provider does not allow to mark sessions or add descriptions.| Modifier and Type | Method and Description |
|---|---|
void |
delete()
Deletes the session and all its entries from the local database.
|
android.content.Context |
getContext()
Returns the application context.
|
android.net.Uri |
getSessionContentUri()
Returns the session read-only content Uri.
|
android.net.Uri |
getSessionEntriesUri()
Returns the session entries
Uri. |
android.net.Uri |
getSessionUri()
Returns the session
Uri. |
static LocalLogSession |
newSession(android.content.Context context,
android.net.Uri authority,
java.lang.String key,
java.lang.String name)
Creates new logger session.
|
public static LocalLogSession newSession(@NonNull android.content.Context context, @NonNull android.net.Uri authority, @NonNull java.lang.String key, @NonNull java.lang.String name)
null.context - the context (activity, service or application)authority - the LocalLogContentProvider authoritykey - the session key, which is used to group sessionsname - the human readable session nameLogContract that can be used to append log entries or null
if MCP is not installed. The null value can be next passed to logging methodspublic void delete()
@NonNull public android.content.Context getContext()
ILogSessiongetContext in interface ILogSession@NonNull public android.net.Uri getSessionUri()
ILogSessionUri. The Uri may be saved in
Activity.onSaveInstanceState(android.os.Bundle) to recreate the session using
Logger.openSession(Context, Uri) when orientation change.
Use this Uri also to open the log session in the nRF Logger.
Intent intent = new Intent(Intent.ACTION_VIEW, mLogSession.getSessionUri()); startActivity(intent);
getSessionUri in interface ILogSession@NonNull public android.net.Uri getSessionEntriesUri()
ILogSessionUri. New log entries may be inserted using this Uri.getSessionEntriesUri in interface ILogSession@NonNull public android.net.Uri getSessionContentUri()
ILogSession[Application name], [Creation date] [Session name] ([Session key]) D 10.34.01.124 This is the oldest log message (debug) V 10.34.02.238 This is the log message (verbose) I 10.34.03.527 This is the log message (info) A 10.34.04.612 This is the log message (application) W 10.34.04.812 This is the log message (warning) E 10.34.05.452 This is the newest log message (error)
getSessionContentUri in interface ILogSessionUri that can be read using
ContentResolver.query(Uri, String[], String, String[], String) method.
The value will be in the first row, column number 0
(with id: LogContract.Session.Content.CONTENT).