Being a bit of a reliability freak, I really enjoy knowing what's going on in my app. How it moves from one line of code to the next.
Verbose
The word "verbose" literally means more words than necessary. This mode usually show how the program's flow control.
1 2 3 4 |
// Verbose Log.v(TAG, "About to create a thread"); Thread t = new Thread(); Log.v(TAG, "Created a thread"); |
Debug
Debugging has the next level in the hierarchy. Debugging is usually used to show values from particular parts of the program e.g.
1 2 3 4 |
// Debug public void lol(int x, int y) { Log.d(TAG, "lol("+Integer.toString(x) + ", " + Integer.toString(x) + ")"); } |
Information
Information logging is quite important. It comes especially useful in asynchronous tasks e.g.
1 2 |
// Information Log.i(TAG, "Device has been found. MAC address: " + device.getDeviceMAC() + "); |
Warning
Warnings are important. They inform us if the application may behave... for a lack of a better word: "oddly". For instance, server is not responding, but you try a different one e.g.
1 2 3 4 5 |
// public void connectToServer() { ... Log.w(TAG, "Server is not responding. Try a different one"); } |
Error
Errors are very important. They inform us that the application cannot proceed with execution because a precondition was not satisfied for some reason.
1 2 3 4 5 |
try { this.sensorManager.register() } catch(Exception e) { Log.e(TAG, "The sensor could not be loaded. The game will not work."); } |
Fatal
This is only used to prevent data loss -> bluescreen of death