-
Notifications
You must be signed in to change notification settings - Fork 7
/
LogsApi.kt
187 lines (173 loc) · 7.4 KB
/
LogsApi.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
package io.embrace.android.embracesdk
/**
* The public API that is used to send log messages.
*/
internal interface LogsApi {
/**
* Remotely logs a message at the given severity level. These log messages will appear as part of the session
* timeline, and can be used to describe what was happening at a particular time within the app.
*
* @param message the message to remotely log
* @param severity the severity level of the log message
*/
fun logMessage(
message: String,
severity: Severity,
)
/**
* Remotely logs a message at the given severity level. These log messages will appear as part of the session
* timeline, and can be used to describe what was happening at a particular time within the app.
*
* @param message the message to remotely log
* @param severity the severity level of the log message
* @param properties the properties to attach to the log message
*/
fun logMessage(
message: String,
severity: Severity,
properties: Map<String, Any>?,
)
/**
* Remotely logs a message at INFO level. These log messages will appear as part of the session
* timeline, and can be used to describe what was happening at a particular time within the app.
*
* @param message the message to remotely log
*/
fun logInfo(message: String)
/**
* Remotely logs a message at WARN level. These log messages will appear as part of the session
* timeline, and can be used to describe what was happening at a particular time within the app.
*
* @param message the message to remotely log
*/
fun logWarning(message: String)
/**
* Remotely logs a message at ERROR level. These log messages will appear as part of the session
* timeline, and can be used to describe what was happening at a particular time within the app.
*
* @param message the message to remotely log
*/
fun logError(message: String)
/**
* Remotely logs a Throwable/Exception at ERROR level. These log messages and stacktraces
* will appear as part of the session timeline, and can be used to describe what was happening
* at a particular time within the app.
*
* @param throwable the throwable to remotely log
*/
fun logException(throwable: Throwable)
/**
* Remotely logs a Throwable/Exception at given severity level. These log messages and stacktraces
* will appear as part of the session timeline, and can be used to describe what was happening
* at a particular time within the app.
*
* @param throwable the throwable to remotely log
* @param severity the severity level of the log message
*/
fun logException(
throwable: Throwable,
severity: Severity,
)
/**
* Remotely logs a Throwable/Exception at given severity level. These log messages and stacktraces
* will appear as part of the session timeline, and can be used to describe what was happening
* at a particular time within the app.
*
* @param throwable the throwable to remotely log
* @param severity the severity level of the log message
* @param properties custom key-value pairs to include with the log message
*/
fun logException(
throwable: Throwable,
severity: Severity,
properties: Map<String, Any>?,
)
/**
* Remotely logs a Throwable/Exception at given severity level. These log messages and stacktraces
* will appear as part of the session timeline, and can be used to describe what was happening
* at a particular time within the app.
*
* @param throwable the throwable to remotely log
* @param severity the severity level of the log message
* @param properties custom key-value pairs to include with the log message
* @param message the message to remotely log instead of the throwable message
*/
fun logException(
throwable: Throwable,
severity: Severity,
properties: Map<String, Any>?,
message: String?,
)
/**
* Remotely logs a custom stacktrace at ERROR level. These log messages and stacktraces
* will appear as part of the session timeline, and can be used to describe what was happening
* at a particular time within the app.
*
* @param stacktraceElements the stacktrace to remotely log
*/
fun logCustomStacktrace(stacktraceElements: Array<StackTraceElement>)
/**
* Remotely logs a custom stacktrace at given severity level. These log messages and stacktraces
* will appear as part of the session timeline, and can be used to describe what was happening
* at a particular time within the app.
*
* @param stacktraceElements the stacktrace to remotely log
* @param severity the severity level of the log message
*/
fun logCustomStacktrace(
stacktraceElements: Array<StackTraceElement>,
severity: Severity,
)
/**
* Remotely logs a custom stacktrace at given severity level. These log messages and stacktraces
* will appear as part of the session timeline, and can be used to describe what was happening
* at a particular time within the app.
*
* @param stacktraceElements the stacktrace to remotely log
* @param severity the severity level of the log message
* @param properties custom key-value pairs to include with the log message
*/
fun logCustomStacktrace(
stacktraceElements: Array<StackTraceElement>,
severity: Severity,
properties: Map<String, Any>?,
)
/**
* Remotely logs a custom stacktrace at given severity level. These log messages and stacktraces
* will appear as part of the session timeline, and can be used to describe what was happening
* at a particular time within the app.
*
* @param stacktraceElements the stacktrace to remotely log
* @param severity the severity level of the log message
* @param properties custom key-value pairs to include with the log message
* @param message the message to remotely log instead of the throwable message
*/
fun logCustomStacktrace(
stacktraceElements: Array<StackTraceElement>,
severity: Severity,
properties: Map<String, Any>?,
message: String?,
)
/**
* Saves captured push notification information into session payload
*
* @param title the title of the notification as a string (or null)
* @param body the body of the notification as a string (or null)
* @param topic the notification topic (if a user subscribed to one), or null
* @param id A unique ID identifying the message
* @param notificationPriority the notificationPriority of the message (as resolved on the device)
* @param messageDeliveredPriority the priority of the message (as resolved on the server)
* @param isNotification if it is a notification message.
* @param hasData if the message contains payload data.
*/
fun logPushNotification(
title: String?,
body: String?,
topic: String?,
id: String?,
notificationPriority: Int?,
messageDeliveredPriority: Int?,
isNotification: Boolean?,
hasData: Boolean?,
)
}