dokilog / com.dokidevs.dokilog / LogProfile
open class LogProfile
Log profile which can be extended to customise log format.
profileName - Unique name for the profile. See DokiLog.addProfile.
| Name | Summary |
|---|---|
| <init> | LogProfile(profileName: String)Log profile which can be extended to customise log format. |
| Name | Summary |
|---|---|
| callStackIndex | var callStackIndex: IntIndex for the StackTraceElement in getStackTraceElement. This is dependent on your code. For this library, callStackIndex = 3. Do not override this unless you are overriding other methods and the StackTraceElement returned is incorrect. |
| filterTag | var filterTag: StringCustom tag used for filtering when going through logcat. Default = “Doki”. By default, this is included in getTag as part of the tag. |
| profileName | val profileName: StringUnique name for the profile. See DokiLog.addProfile. |
| Name | Summary | |
|---|---|---|
| adjustPriority | open fun adjustPriority(priority: Int): IntAdjust the priority for certain conditions. By default, there is no adjustment. Source code shows how to change the priority based on device manufacturer. |
|
| equals | open fun equals(other: Any?): Boolean |
|
| getStackTraceElement | open fun getStackTraceElement(): StackTraceElementGet the related StackTraceElement where the parent method is called. It will contain useful information such as className, methodName, lineNumber etc. Override this only if the StackTraceElement returned is incorrect. |
|
| getStackTraceString | open fun getStackTraceString(t: Throwable): StringMethod to get stack trace from Throwable. This is from Timber (by Jake Wharton) which unhides UnknownHostException, compared to default Android Log.getStackTraceString(). |
|
| getTag | open fun getTag(className: String, stackTraceElement: StackTraceElement): StringGet defined tag for the log. Default has the format of “$filterTag - $className |
${stackTraceElement.methodName}” |
| hashCode | open fun hashCode(): Int |
|
| isLoggable | open fun isLoggable(priority: Int): BooleanSets the condition to log based on priority. Default = true. |
|
| log | open fun log(priority: Int, tag: String?, message: String): UnitActual log method. This is from Timber (by Jake Wharton) to split log according to maximum length defined by MAX_LOG_LENGTH. |
|
| prepareLog | open fun prepareLog(priority: Int, t: Throwable? = null, message: String?, className: String): UnitEntry point to the whole logging process. Prepare log based on message and throwable. If both are null, the message is set as “called”, so that no message is swallowed. This is useful for checking the method calls sequence. For example, simply call v(), d(), etc. anywhere and it will return “methodName: called”. |
| Name | Summary |
|---|---|
| MAX_LOG_LENGTH | const val MAX_LOG_LENGTH: Int |
| MAX_TAG_LENGTH | const val MAX_TAG_LENGTH: Int |