Skip to content

Commit

Permalink
Removed unused "track" code (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssawchenko committed Aug 14, 2023
1 parent ed0899e commit 4f16163
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 58 deletions.
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 (#114)


## Jitpack v2.3 : Jun 19, 2023
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,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 @@ -91,22 +91,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 @@ -118,27 +107,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 @@ -156,11 +144,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

0 comments on commit 4f16163

Please sign in to comment.