-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move event type to avoid compiler warning
- Loading branch information
1 parent
c1873f2
commit e7a9262
Showing
36 changed files
with
220 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 0 additions & 67 deletions
67
embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/EmbraceEvent.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/EventType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package io.embrace.android.embracesdk | ||
|
||
import android.annotation.SuppressLint | ||
import com.squareup.moshi.Json | ||
import io.embrace.android.embracesdk.annotation.InternalApi | ||
|
||
/** | ||
* Models the different types of Event. | ||
*/ | ||
@InternalApi | ||
@SuppressLint("EmbracePublicApiPackageRule") | ||
internal enum class EventType( | ||
|
||
/** | ||
* The abbreviation used in the story ID header when sending the event to the Embrace | ||
* API using the [ApiClient]. | ||
* | ||
* @return the abbreviation for the event type | ||
*/ | ||
val abbreviation: String | ||
) { | ||
|
||
@Json(name = "start") | ||
START("s"), | ||
|
||
@Json(name = "late") | ||
LATE("l"), | ||
|
||
@Json(name = "interrupt") | ||
INTERRUPT("i"), | ||
|
||
@Json(name = "crash") | ||
CRASH("c"), | ||
|
||
@Json(name = "end") | ||
END("e"), | ||
|
||
@Json(name = "info") | ||
INFO_LOG("il"), | ||
|
||
@Json(name = "error") | ||
ERROR_LOG("el"), | ||
|
||
@Json(name = "warning") | ||
WARNING_LOG("wl"), | ||
|
||
@Json(name = "network") | ||
NETWORK_LOG("n"); | ||
|
||
companion object { | ||
fun fromSeverity(severity: Severity): EventType { | ||
return when (severity) { | ||
Severity.INFO -> INFO_LOG | ||
Severity.WARNING -> WARNING_LOG | ||
Severity.ERROR -> ERROR_LOG | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.