Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#64] Removed unused "track" code #120

Merged
merged 3 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The format is based on the Steamclock [Release Management Guide](https://github.
## Unreleased
- Allow more than one log to be attached to a Sentry report (#115)
- Fixed issue with log auto rotation (#115)
- Removed unused "track" code (#64)
- Config.extraInfo now optional (#114)

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ class MainActivity : AppCompatActivity() {
binding.singleNonFatal.setOnClickListener{ testSingleNonFatal() }
binding.userReport.setOnClickListener { testUserReport() }
binding.logBlockedException.setOnClickListener { testBlockedException() }
binding.trackAnalytic.setOnClickListener {
Toast.makeText(applicationContext, "Not supported", Toast.LENGTH_LONG).show()
}
binding.enableUserReportLogs.setOnCheckedChangeListener { _, checked ->
clog.config.detailedLogsOnUserReports = checked
}
Expand Down
29 changes: 9 additions & 20 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,22 +97,11 @@

<Button
style="@style/Widget.AppCompat.Button.Colored"
android:id="@+id/single_non_fatal"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="Report Single Error"
android:backgroundTint="@android:color/holo_red_dark"
android:layout_gravity="center"/>

<Button
style="@style/Widget.AppCompat.Button.Colored"
android:id="@+id/all_non_fatals"
android:id="@+id/dump_file_button"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="Report Multiple Errors"
android:backgroundTint="@android:color/holo_red_dark"
android:text="SHOW FILE DUMP"
android:layout_gravity="center"/>

</LinearLayout>
Expand All @@ -124,27 +113,26 @@

<Button
style="@style/Widget.AppCompat.Button.Colored"
android:id="@+id/log_blocked_exception"
android:id="@+id/single_non_fatal"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="Report Blocked Exception"
android:text="Report Single Error"
android:backgroundTint="@android:color/holo_red_dark"
android:layout_gravity="center"/>

<Button
style="@style/Widget.AppCompat.Button.Colored"
android:id="@+id/track_analytic"
android:id="@+id/all_non_fatals"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="Report Analytic Event"
android:text="Report Multiple Errors"
android:backgroundTint="@android:color/holo_red_dark"
android:layout_gravity="center"/>

</LinearLayout>


<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -162,11 +150,12 @@

<Button
style="@style/Widget.AppCompat.Button.Colored"
android:id="@+id/dump_file_button"
android:id="@+id/log_blocked_exception"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="SHOW FILE DUMP"
android:text="Report Blocked Exception"
android:backgroundTint="@android:color/holo_red_dark"
android:layout_gravity="center"/>

</LinearLayout>
Expand Down
35 changes: 0 additions & 35 deletions steamclog/src/main/java/com/steamclock/steamclog/Steamclog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -109,41 +109,6 @@ object SteamcLog {
Timber.log(logLevel.javaLevel, wrapper)
}

// todo #64 Re-implement track method; was removed when we ported over to using Sentry
// fun track(@NonNls id: String, data: Map<String, Any?>) {
// if (!config.logLevel.analyticsEnabled) {
// logInternal(LogLevel.Info, "Anayltics not enabled ($id)")
// return
// }
//
// if (config.firebaseAnalytics == null) {
// logInternal(LogLevel.Info, "Firebase analytics instance not set ($id)")
// return
// }
//
// val bundle = Bundle()
// data.forEach { (key, value) ->
// when (value) {
// is Redactable -> {
// bundle.putString(key, value.getRedactedDescription())
// }
// is Serializable -> {
// bundle.putSerializable(key, value)
// }
// is Parcelable -> {
// bundle.putParcelable(key, value)
// }
// else -> {
// warn("Failed to encode $value to bundle, must be either parcelable, serializable or redactable")
// return
// }
// }
// }
//
// // Obtain the FirebaseAnalytics instance from the config.
// config.firebaseAnalytics?.apply { logEvent(id, bundle) }
// }

//---------------------------------------------
// Public util methods
//---------------------------------------------
Expand Down