|
|
@ -5,44 +5,44 @@
|
|
|
|
package org.mozilla.fenix.ext
|
|
|
|
package org.mozilla.fenix.ext
|
|
|
|
|
|
|
|
|
|
|
|
import android.util.Log
|
|
|
|
import android.util.Log
|
|
|
|
import org.mozilla.fenix.BuildConfig
|
|
|
|
import org.mozilla.fenix.Config
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Will print to `Log.d()` only when [BuildConfig.DEBUG] is enabled.
|
|
|
|
* Will print to `Log.d()` only for debug release channels.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Meant to be used for logs that should not be visible in the production app.
|
|
|
|
* Meant to be used for logs that should not be visible in the production app.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Suppress("NOTHING_TO_INLINE")
|
|
|
|
@Suppress("NOTHING_TO_INLINE")
|
|
|
|
inline fun logDebug(tag: String, message: String) {
|
|
|
|
inline fun logDebug(tag: String, message: String) {
|
|
|
|
if (BuildConfig.DEBUG) Log.d(tag, message)
|
|
|
|
if (Config.channel.isDebug) Log.d(tag, message)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Will print to `Log.w()` only when [BuildConfig.DEBUG] is enabled.
|
|
|
|
* Will print to `Log.w()` only for debug release channels.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Meant to be used for logs that should not be visible in the production app.
|
|
|
|
* Meant to be used for logs that should not be visible in the production app.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Suppress("NOTHING_TO_INLINE")
|
|
|
|
@Suppress("NOTHING_TO_INLINE")
|
|
|
|
inline fun logWarn(tag: String, message: String) {
|
|
|
|
inline fun logWarn(tag: String, message: String) {
|
|
|
|
if (BuildConfig.DEBUG) Log.w(tag, message)
|
|
|
|
if (Config.channel.isDebug) Log.w(tag, message)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Will print to `Log.w()` only when [BuildConfig.DEBUG] is enabled.
|
|
|
|
* Will print to `Log.w()` only for debug release channels.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Meant to be used for logs that should not be visible in the production app.
|
|
|
|
* Meant to be used for logs that should not be visible in the production app.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Suppress("NOTHING_TO_INLINE")
|
|
|
|
@Suppress("NOTHING_TO_INLINE")
|
|
|
|
inline fun logWarn(tag: String, message: String, err: Throwable) {
|
|
|
|
inline fun logWarn(tag: String, message: String, err: Throwable) {
|
|
|
|
if (BuildConfig.DEBUG) Log.w(tag, message, err)
|
|
|
|
if (Config.channel.isDebug) Log.w(tag, message, err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Will print to `Log.e()` only when [BuildConfig.DEBUG] is enabled.
|
|
|
|
* Will print to `Log.e()` only for debug release channels.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Meant to be used for logs that should not be visible in the production app.
|
|
|
|
* Meant to be used for logs that should not be visible in the production app.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Suppress("NOTHING_TO_INLINE")
|
|
|
|
@Suppress("NOTHING_TO_INLINE")
|
|
|
|
inline fun logErr(tag: String, message: String, err: Throwable) {
|
|
|
|
inline fun logErr(tag: String, message: String, err: Throwable) {
|
|
|
|
if (BuildConfig.DEBUG) Log.e(tag, message, err)
|
|
|
|
if (Config.channel.isDebug) Log.e(tag, message, err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|