Skip to content
cescoffier edited this page Sep 22, 2010 · 18 revisions

Androlog is a wrapper on the top of the Androlog Log system allowing:

  • The enabling / disabling of the logging
  • Configuring the log level per tag
  • Logging message with simpler method (no tag required)
  • Configuring the logging per application

Androlog supports Android 1.6+ and is licenced under the Apache License 2.0. This project is founded by akquinet A.G..

Motivations

When you're developing Android applications, you generally use the Android logger. However, this logging system is too simplistic to meet sophisticated application development requirement:

  • All log messages are displaying in the console (logcat), regardless the log level and the tag
  • There is no way to disable the logging easily without removing all Log.x calls. However this is required before uploading your application in the marketplace.

Brief description

Androlog is a pretty small library that you can embed in your Android application. Instead of calling android.util.Log, you just use de.akquinet.android.androlog.Log (a simple replace on the import statements works). The provided API is similar to the Android Log. So androlog provides the same log levels : VERBOSE, DEBUG, INFO, WARN, and ERROR with the same methods : Log.v, Log.d, Log.i, Log.w, Log.e.

The following code snippet use Androlog:

import de.akquinet.android.androlog.Log;

public class AndrologExample {
    public static final String TAG = "MY_TAG";
    public void doSomething() {
        Log.i(TAG, "A message");
    }
}
As you can see it is really similar to the Android log. However, this logging system can be configured to:
  • disabled all messages (for releases)
  • configure the log level per TAG,
  • configure a default log level
  • configure different logging policy per application

Documentation

Clone this wiki locally