Skip to main content

Log

Description

The library uses different logging levels to report errors, warnings, useful messages, and the flow of execution of the utilities.

tip

You can use these instructions to show the logcat messages colored.

note

If you have configured minifyEnabled true in android > buildTypes > release on your app Gradle file, all log messages emitted by the library will be removed from the APK or App Bundle you generate for production, as they are not considered useful or necessary for this environment.


Logging Levels

Error

It uses Log.e(), it indicates that something has not worked as expected, depending on the error, it can only appear the message or the exception details in the logcat, or it can cause the application to stop.

Warning

It uses Log.w(), it indicates the suspicion that something shady is happening, it may not be exactly an error, but it may also be unexpected behavior.

General

It uses Log.v(), it's used for all other logcat messages, such as useful messages about the library utilities, and to detail the execution flow of the utilities.

The general log can enable and disable as follows:

Base.logEnable = true // or false

The recommended configuration (and default) for the general log is the following, use it the onCreate() of the application class or in the main activity.

Base.logEnable = BuildConfig.DEBUG
note
Base is the superclass of most utilities.