dokilog

dokilog / com.dokidevs.dokilog / DokiLog

DokiLog

interface DokiLog

Main interface for DokiLog. See LogProfile to customize logging.

Properties

Name Summary
className open val className: String
Class name which DokiLog interface is attached to. This will show the subclass even if DokiLog is implemented in the parent class. To show the parent class name instead, get them from the StackTraceElement.getClassName in LogProfile.getTag.
enableClassLog open val enableClassLog: Boolean
Enable log for the class which DokiLog interface is attached to. Override this to enable or disable log for the class.

Companion Object Functions

Name Summary
addProfile fun addProfile(logProfile: LogProfile): Unit
Add a log profile. This is similar to planting a tree in Timber (by Jake Wharton). The profile name must be unique. Newly added profile will overwrite the old profile with the same name.
clearAllProfiles fun clearAllProfiles(): Unit
Remove all log profiles.
hasLogProfiles fun hasLogProfiles(): Boolean
Check if log profiles are present before dispatching the log.
log fun log(priority: Int, className: String, message: String? = null, t: Throwable? = null): Unit
Actual execution method to loop through all log profiles. Entry point to LogProfile.prepareLog. You usually will not call this method directly.
removeProfile fun removeProfile(logProfile: LogProfile): Unit
Remove a log profile. This is similar to uprooting a tree in Timber (by Jake Wharton).

Extension Functions

Name Summary
d fun DokiLog.d(message: String? = null, t: Throwable? = null): Unit
fun DokiLog.d(t: Throwable? = null): Unit
Log at Log.DEBUG level.
e fun DokiLog.e(message: String? = null, t: Throwable? = null): Unit
fun DokiLog.e(t: Throwable? = null): Unit
Log at Log.ERROR level.
v fun DokiLog.v(message: String? = null, t: Throwable? = null): Unit
fun DokiLog.v(t: Throwable? = null): Unit
Log at Log.VERBOSE level.
w fun DokiLog.w(message: String? = null, t: Throwable? = null): Unit
fun DokiLog.w(t: Throwable? = null): Unit
Log at Log.WARN level.
wtf fun DokiLog.wtf(message: String? = null, t: Throwable? = null): Unit
fun DokiLog.wtf(t: Throwable? = null): Unit
Log at Log.ASSERT level.