komamitsu / android-logger-bridge

android-logger-bridge enables using Android Log util on non Android envinronment. If this library runs on Android, it outputs to logcat. If not, it outputs to stdout.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

android-logger-bridge

android-logger-bridge enables using Android Log util on non Android envinronment. If this library runs on Android, it outputs to logcat. If not, it outputs to stdout.

Requirement

Android OS >= 2.2

Usage

If you're using maven, add the folloing directive:

<dependencies>
  <dependency>
	<groupId>org.komamitsu</groupId>
	<artifactId>android-logger-bridge</artifactId>
	<version>0.0.1</version>
  </dependency>
</dependencies>

If not, download android-logger-bridge-x.x.x.jar from http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22android-logger-bridge%22.

Next, import org.komamitsu.android.util.Log.

import org.komamitsu.android.util.Log;

public class FooActivity {
        private static final String TAG = FooActivity.class.getSimpleName();

             :

        public void onBarEvent() {
            Log.d(TAG, "onBarEvent: start");
                    
                :
                
            try {
                    
                :

            }
            catch (IOException e) {
                Log.e(TAG, "API call error", e);

                    :

About

android-logger-bridge enables using Android Log util on non Android envinronment. If this library runs on Android, it outputs to logcat. If not, it outputs to stdout.

License:Apache License 2.0


Languages

Language:Java 100.0%