aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt
blob: d5c1a6fb12526414446fae8264919b80e1c011db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.pitchedapps.frost.utils

import ca.allanwang.kau.logging.KauLogger
import com.crashlytics.android.Crashlytics
import com.pitchedapps.frost.BuildConfig


/**
 * Created by Allan Wang on 2017-05-28.
 *
 * Logging for frost
 *
 * To ensure privacy, the following rules are set:
 *
 * Debug and Error logs must not reveal person info
 * Person info logs can be marked as info or verbose
 */
object L : KauLogger("Frost") {

    override fun logImpl(priority: Int, message: String?, privateMessage: String?, t: Throwable?) {
        if (BuildConfig.DEBUG) {
            super.logImpl(priority, message, privateMessage, t)
        } else {
            if (message != null)
                Crashlytics.log(priority, "Frost", message)
            if (t != null) Crashlytics.logException(t)
        }
    }
}