Skip to content
cescoffier edited this page Feb 14, 2011 · 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
  • Reporting issue from your application

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

News

  • Androlog 1.0.1 is now available from Maven Central, it supports reporting (14/02/2011).
  • Androlog 1.0.0 is released, you can now download it from github and from the maven repository (24/09/2010).

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.
  • Android reporting was introduced in Android 2+, and is quite limited. Reports just contains the stack trace and a user message. Androlog reporting works on 1.6, contains the logged messages and stack traces. So Androlog reports allow a better understanding of the issues.

Download

You can download the Androlog sources from github. We also provides binaries for convenience:

  • androlog-1.0.1.jar (just add this jar to your build path)
  • Maven dependency (to use with the maven-android-plugin)
    <dependency>
      <groupId>de.akquinet.android.androlog</groupId> 
      <artifactId>androlog</artifactId> 
      <version>1.0.1</version> 
      <scope>compile</scope>
    </dependency>
    Androlog is available on maven central, so you don't need to customize your maven settings.

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