You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create an utility class that simplifies the use of android.util.Log by improving the call to all log methods by supplying arguments as parameters instead of creating a string.
This avoids useless memory allocations when not requested: the StringBuilder itself, the buffer and the String object. The new methods check in advance if the level is enabled and only after creates the string message with arguments.
Also, implement features like:
Automatic TAG corresponding to the caller class name.
Runtime log level without the need of props file (useful for libraries like this).
Method name with line number.
Should use SUPPRESS to disable all logs. For instance:
if (BuildConfig.DEBUG) {
Log.setLevel(Level.INFO);
} else {
Log.setLevel(Level.SUPPRESS);
}
The text was updated successfully, but these errors were encountered:
Create an utility class that simplifies the use of
android.util.Log
by improving the call to all log methods by supplying arguments as parameters instead of creating a string.This avoids useless memory allocations when not requested: the
StringBuilder
itself, the buffer and the String object. The new methods check in advance if the level is enabled and only after creates the string message with arguments.Also, implement features like:
Should use SUPPRESS to disable all logs. For instance:
The text was updated successfully, but these errors were encountered: