Connect Android SDK reference: logging
The page describes the various logging methods that you can use in the Connect Android library.
Event logging
Connect.logCustomEvent
Connect.logCustomEvent
Logs a custom event.
Connect.logCustomEvent(
eventName: String?,
data: HashMap<String?, String?>?
): Boolean
Parameters:
eventName
(required) - the name of the event.data
(optional) - the data to associate with the event.
Connect.logExceptionEvent
Connect.logExceptionEvent
Logs an exception event.
Connect.logExceptionEvent(
name: String?,
message: String?,
stackInfo: String?,
unhandled: Boolean?
): Boolean
Parameters:
name
- the name of an error or exceptionmessage
- the message accompanying the error or exceptionstackInfo
- the stack trace of the error/exceptionunhandled
- indicates whether the exception or error is unhandled.
Connect.logScreenview
Connect.logScreenview
Logs a screen view event.
Connect.logScreenview(
activity: Activity,
logicalPageName: String,
screenviewType: ScreenviewType,
referrer: String?
): Boolean
Parameters:
activity
- the activity where the screen view occurslogicalPageName
- the name of the logical pagereferrer
(optional) - the referrer pagescreenviewType
(optional) - the type of the screen view
Connect.logEvent
Connect.logEvent
Logs an event from a view.
Connect.logEvent(
view: View,
eventType: String,
accessibilityID: String
logLevel: Int
)
Parameters:
view
(required) - the view that triggered the eventeventType
- the type of event.accessibilityID
- the accessibility ID assigned to a UI element in your applogLevel
- the logging level selected
logDialogEvent
logDialogEvent
Logs an event from a dialogue box of the alert type.
Connect.logDialogEvent(
dialog: DialogInterface,
id: Int
eventType: String
logLevel: Int
)
Parameters:
dialog
(required) - the alert dialogid
(required) - the ID of the action buttoneventType
- the type of event.logLevel
- the logging level selected.
Connect.logConnection
Connect.logConnection
Logs a connection
Connect.logConnection(
connection: Connection?
) : Boolean
Connect.takeScreenShot
Connect.takeScreenShot
Takes a screenshot of a view.
Connect.takeScreenShot(
view: View?
) : Boolean
Performance event logging
Connect.logPerformanceEvent
Connect.logPerformanceEvent
Logs a performance event.
Connect.logPerformanceEvent(
logLevel: Int,
navigationType: TLFPerformanceNavigationType?,
redirectCount: Long,
navigationStart: Long,
unloadEventStart: Long,
unloadEventEnd: Long,
redirectStart: Long,
redirectEnd: Long,
loadEventStart: Long,
loadEventEnd: Long
): Boolean
Parameters:
navigationType
- the navigation type.redirectCount
- the redirect count.navigationStart
- the navigation start time.unloadEventStart
- the unload event start time.unloadEventEnd
- the unload event end time.redirectStart
- the redirect start time.redirectEnd
- the redirect end time.loadEventStart
- the load event start time.loadEventEnd
- the load event end time.
Screen layout logging
Connect.logScreenLayout
Connect.logScreenLayout
Logs the layout of an activity.
Connect.logScreenLayout(
activity: Activity
name: String
delayMS: Int
captureScreenShot: Boolean
manualLog: Boolean
alertDialog: Dialog
): Boolean
Parameters:
activity
(required) - the activity to log.name
(optional) - the name of the activity to logdelayMS
- enables a delay (in milliseconds)captureScreenShot
(optional) - initiates the creation of a screenshotmanualLog
- Initiates the creation of a manual loguseOnGlobalLayout
(optional) - initiates logging the layout of an alert dialogue box.
Gesture logging
Connect.dispatchTouchEvent
Connect.dispatchTouchEvent
Dispatches a touch event for gesture logging.
Connect.dispatchTouchEvent(
activity: Activity?,
motionEvent: MotionEvent?
): Boolean
Connect.logGestureEvent
Connect.logGestureEvent
Logs a gesture event.
Connect.logGestureEvent(
activity: Activity?,
motionEvent: MotionEvent?,
eventType: String?,
logicalPageName: String?
): CountDownLatch
Connect.logPinchGestureEvent
Connect.logPinchGestureEvent
Logs a pinch gesture event.
Connect.logPinchGestureEvent(
activity: Activity?,
pinchData: PinchData?,
eventType: String?,
logLevel: Int,
logicalPageName: String?
): CountDownLatch
Connect.logFlingGestureEvent
Connect.logFlingGestureEvent
Logs a fling gesture event.
Connect.logFlingGestureEvent(
activity: Activity?,
motionEvent1: MotionEvent?,
motionEvent2: MotionEvent?,
velocityX: Float,
velocityY: Float,
eventType: String?,
logicalPageName: String?
logLevel: Int,
): CountDownLatch
Parameters:
motionEvent1
- the first down motion event.motionEvent2
- the move motion event that triggered the onFling.velocityX
- the velocity along the x-axis.velocityY
- the velocity along the y-axis.logLevel
(optional) - the log level enabled
Form logging
Connect.registerFormField
Connect.registerFormField
Registers a form field.
Connect.registerFormField(
formField: View,
activity: Activity
logLevel: Int
): Boolean
Parameters:
formField
- the form field to register.logLevel
(optional) - preferred logging level
Connect.logFormCompletion
Connect.logFormCompletion
Logs a form completion event.
Connect.logFormCompletion(
submitted: Boolean?,
isValid: Boolean?
): Boolean
Parameters:
submitted
- indicates whether the form was submitted.isValid
- indicates whether the submitted data was valid.
Log level
Connect.getDefaultLogLevel
Connect.getDefaultLogLevel
Get the default log level.
Connect.getDefaultLogLevel(): Int
Logging environmental data
Connect.logGeolocation
Connect.logGeolocation
Logs a geolocation event.
Connect.logGeolocation(
logLevel: Int
): Boolean
Connect.logLocationUpdateEventWithLatitude
Connect.logLocationUpdateEventWithLatitude
Logs a location update event.
Connect.logLocationUpdateEventWithLatitude(
latitude: Double,
longitude: Double,
logLevel: Int
): Boolean
Parameters:
latitude
- the latitude value.longitude
- the longitude value.
Related pages
Updated about 1 month ago