Skip to content

Commit 91dc9e7

Browse files
committed
print entire stack trace on error
1 parent e0bc52b commit 91dc9e7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

android/src/main/kotlin/com/icapps/background_location_tracker/service/LocationUpdatesService.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import com.icapps.background_location_tracker.utils.ActivityCounter
2323
import com.icapps.background_location_tracker.utils.Logger
2424
import com.icapps.background_location_tracker.utils.NotificationUtil
2525
import com.icapps.background_location_tracker.utils.SharedPrefsUtil
26+
import java.io.PrintWriter
27+
import java.io.StringWriter
2628

2729
private const val timeOut = 24 * 60 * 60 * 1000L /*24 hours max */
2830

@@ -143,7 +145,10 @@ internal class LocationUpdatesService : Service() {
143145
NotificationUtil.startForeground(this, location)
144146
}
145147
} catch(e:Throwable) {
146-
Logger.error(e.message ?: "","onUnbind failed to execute");
148+
val sw = StringWriter()
149+
val pw = PrintWriter(sw)
150+
e.printStackTrace(pw)
151+
Logger.error(sw.toString(),"onUnbind failed to execute");
147152
}
148153

149154
return true // Ensures onRebind() is called when a client re-binds.

0 commit comments

Comments
 (0)