package de.tsschulz.timeclock

import android.app.Application
import android.util.Log

class TimeClockApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        Log.i(TAG, "Application started")
        val previousHandler = Thread.getDefaultUncaughtExceptionHandler()
        Thread.setDefaultUncaughtExceptionHandler { thread, throwable ->
            Log.e(TAG, "Uncaught exception on ${thread.name}", throwable)
            previousHandler?.uncaughtException(thread, throwable)
        }
    }

    private companion object {
        const val TAG = "TimeClockStartup"
    }
}
