Why does Android
maintain 2 different Log classes that seem to support the same things?
I'm talking about:
Log
android.util.Log
Logger
java.util.logging.Logger
For what I've seen for some years developing, every Android official documentation points to the Log
and not the Logger.
Even specific loggers like the TimingLogger uses the Log
.
So why are those 2 supported?
Are there any feature that can be used through Logger
than I can't achieve through Log
?
Are there specific use cases for both?
One of the most popular solutions for the Java world is the Apache Log4j 2 framework.
A Logger object is used to log messages for a specific system or application component. Loggers are normally named, using a hierarchical dot-separated namespace. Logger names can be arbitrary strings, but they should normally be based on the package name or class name of the logged component, such as java.net or javax.
The JDK Logging Adapter is a custom implementation of java. util. logging. LogManager that uses Log4j.
The four Android log buffers are main, events, radio and system. The main log is for the application, events is for system event information, radio is for phone-related information and system is low-level system messages and debugging.
The feature crossover seems to be:
Seems like "android.util.Log" is going to have:
Looks like "J.U.L" is going to have:
SEVERE
error occurs you can include the last 1000 records which may be at lower level.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