In my Android app, I am trying to implement logger. While doing so I see Android packages use slog, and I see there is Log under android.util package, which is being used widely in the application, see below code:
Slog
Slog.v(TAG, "onCreate " + this + ": " + savedInstanceState)
Log
Log.v(TAG, e.printStackTrace())
what is difference between the above logs.
For future readers of this post, Slog is simply a wrapper over the standard android.util.Log which logs its output under the Log.LOG_ID_SYSTEM id.
There are five different IDs under which the logs are categorized and those are:
LOG_ID_MAIN: For the main buffer under which all common application logs go.
LOG_ID_SYSTEM: For the system log buffer where all system services logs.
LOG_ID_RADIO: For logging radio-related events.
LOG_ID_EVENTS: For logging system and sensor events.
LOG_ID_CRASH: For logging crashes and wtf failures

Image source: https://elinux.org/Android_Logging_System
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With