Skip to content

Commit

Permalink
update: logger ease of use
Browse files Browse the repository at this point in the history
  • Loading branch information
ViscousPot committed Oct 28, 2024
1 parent 55df295 commit ebd2313
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/viscouspot/gitsync/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class MainActivity : AppCompatActivity() {
setContentView(R.layout.main_activity)

Thread.setDefaultUncaughtExceptionHandler { _, paramThrowable ->
log(this, LogType.Global, Exception(paramThrowable))
log(this, LogType.Global, paramThrowable)
}

settingsManager = SettingsManager(this)
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/com/viscouspot/gitsync/util/Logger.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ object Logger {
addToLast5Logs(type, message)
}

fun log(message: String) {
Log.d("///Git Sync//${LogType.TEST.type}", message)
addToLast5Logs(LogType.TEST, message)
fun log(message: Any?) {
Log.d("///Git Sync//${LogType.TEST.type}", message?.toString() ?: "null")
addToLast5Logs(LogType.TEST, message?.toString() ?: "null")
}

private fun addToLast5Logs(type: LogType, message: String) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<string name="report_bug">&lt;GitSync Error&gt; Tap to send a bug report</string>
<string name="enable_notifications">Enable notifications permission to see more.</string>
<string name="select_email_client">"Send email using: "</string>
<string name="select_email_client">Send email using: </string>
<string name="dismiss">Dismiss</string>

<string name="docs_link">https://github.com/ViscousPotential/GitSync/blob/master/Documentation.md</string>
Expand Down

0 comments on commit ebd2313

Please sign in to comment.