https://github.com/chrimaeon/lint-logdebug
Android Lint checks for log output
https://github.com/chrimaeon/lint-logdebug
android koltin lint linter log logging
Last synced: about 2 months ago
JSON representation
Android Lint checks for log output
- Host: GitHub
- URL: https://github.com/chrimaeon/lint-logdebug
- Owner: chrimaeon
- License: apache-2.0
- Created: 2019-05-17T18:07:01.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-09-23T11:53:00.000Z (almost 3 years ago)
- Last Synced: 2025-06-10T03:04:56.126Z (about 1 year ago)
- Topics: android, koltin, lint, linter, log, logging
- Language: Kotlin
- Homepage:
- Size: 280 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Android Lint for log output [](https://github.com/chrimaeon/lint-logdebug/actions/workflows/main.yml)
[](https://www.apache.org/licenses/LICENSE-2.0)
[](https://repo1.maven.org/maven2/com/cmgapps/android/lint-logdebug)
Check your code for missing conditional surrounding your log output.
The `BuildConfig` class provides a constant, `DEBUG`, which indicates whether the code is being built in release mode or
in debug mode. In release mode, you typically want to strip out all the logging calls. Since the compiler will
automatically remove all code which is inside a `if (false)` check, surrounding your logging calls with a check for
`BuildConfig.DEBUG` is a good idea.
If you *really* intend for the logging to be present in release mode, you can suppress this warning with
a `@SuppressLint`
annotation for the intentional logging calls.
## Usage
Add this to your dependencies in the modules `build.gradle`
```kotlin
dependencies {
implementation("com.cmgapps.android:lint-logdebug:")
}
```
## License
```text
Copyright (c) 2019. Christian Grach
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.
```