This is an annotation processor that will generate an appropriate log tag for Android Log messages
using KSP
The library supports KSP (Kotlin Symbol Processing API)
Add the processor and annotation libraries to the projects dependencies
dependencies {
implementation("com.cmgapps:log-tag:1.1.0")
ksp("com.cmgapps:log-tag-processor:1.1.0")
}
also get sure to apply the KSP Gradle Plugin
plugins {
id("com.google.devtools.ksp") version "1.1.0"
}
using KAPT
Add the processor and annotation libraries to the projects dependencies
dependencies {
implementation("com.cmgapps:log-tag:1.1.0")
kapt("com.cmgapps:log-tag-processor:1.1.0")
}
also get sure to apply the Annotation Processor Plugin
plugins {
kotlin("kapt")
}
In your source file add the com.cmgapps.LogTag
annotation to the class file you want to have a log tag generated:
@com.cmgapps.LogTag
class SuperImportantClass
-
For Kotlin classes this will generate an extension property to you class called
LOG_TAG
you can then use as the tag for your android log messages. -
For Java it will generate a class called
<Classname>LogTag
which has a constant field calledLOG_TAG
you can then import to tag your android log messages -
For Jetpack Compose you can annotate the
@Composable
function for the processor to generate a class calledComposable<Composable function name>
with a companion object propertyLOG_TAG
Copyright (c) 2021. Christian Grach <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.