// Path: src/main/java/org/n52/geoar/newdata/PluginLogger.java
// public class PluginLogger implements DataSourceLoggerFactory.Logger {
// 
// 	private org.slf4j.Logger logger;
// 
// 	public PluginLogger(PluginHolder plugin, Class<?> clazz) {
// 		logger = LoggerFactory.getLogger(plugin.getIdentifier() + "-"
// 				+ clazz.getSimpleName());
// 	}
// 
// 	public PluginLogger(Class<?> clazz) {
// 		logger = LoggerFactory.getLogger(clazz);
// 	}
// 
// 	@Override
// 	public void warn(String message) {
// 		logger.warn(message);
// 	}
// 
// 	@Override
// 	public void error(String message) {
// 		logger.error(message);
// 	}
// 
// 	@Override
// 	public void info(String message) {
// 		logger.info(message);
// 	}
// 
// 	@Override
// 	public void warn(String message, Throwable ex) {
// 		logger.warn(message, ex);
// 	}
// 
// 	@Override
// 	public void error(String message, Throwable ex) {
// 		logger.error(message, ex);
// 	}
// 
// 	@Override
// 	public void info(String message, Throwable ex) {
// 		logger.info(message, ex);
// 	}
// 
// }


import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.lang.Thread.UncaughtExceptionHandler;
import java.util.ArrayList;
import java.util.List;
import org.n52.geoar.utils.DataSourceLoggerFactory;
import org.n52.geoar.utils.DataSourceLoggerFactory.LoggerCallable;
import org.n52.geoar.newdata.PluginLogger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import android.app.Activity;
import android.app.Application;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.widget.Toast;

		Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {

			@Override
			public void uncaughtException(Thread thread, Throwable ex) {
				LOG.error("Uncaught exception in thread " + thread.getName(),
						ex);
				try {
					FileOutputStream fos = openFileOutput(STACKTRACE_FILENAME,
							Context.MODE_PRIVATE);
					ex.printStackTrace(new PrintStream(fos));
					fos.close();
				} catch (FileNotFoundException e) {
					e.printStackTrace();
				} catch (IOException e) {
					e.printStackTrace();
				}

				// fall back to standard handler
				if (defaultUncaughtExceptionHandler != null) {
					defaultUncaughtExceptionHandler.uncaughtException(thread,
							ex);
				}
			}
		});

		// ensure that plugins can access the main logger
		DataSourceLoggerFactory.setLoggerCallable(new LoggerCallable() {
			@Override
			public org.n52.geoar.utils.DataSourceLoggerFactory.Logger call(
					Class<?> clazz) {

// Path: src/main/java/org/n52/geoar/newdata/PluginLogger.java
// public class PluginLogger implements DataSourceLoggerFactory.Logger {
// 
// 	private org.slf4j.Logger logger;
// 
// 	public PluginLogger(PluginHolder plugin, Class<?> clazz) {
// 		logger = LoggerFactory.getLogger(plugin.getIdentifier() + "-"
// 				+ clazz.getSimpleName());
// 	}
// 
// 	public PluginLogger(Class<?> clazz) {
// 		logger = LoggerFactory.getLogger(clazz);
// 	}
// 
// 	@Override
// 	public void warn(String message) {
// 		logger.warn(message);
// 	}
// 
// 	@Override
// 	public void error(String message) {
// 		logger.error(message);
// 	}
// 
// 	@Override
// 	public void info(String message) {
// 		logger.info(message);
// 	}
// 
// 	@Override
// 	public void warn(String message, Throwable ex) {
// 		logger.warn(message, ex);
// 	}
// 
// 	@Override
// 	public void error(String message, Throwable ex) {
// 		logger.error(message, ex);
// 	}
// 
// 	@Override
// 	public void info(String message, Throwable ex) {
// 		logger.info(message, ex);
// 	}
// 
// }


// Path: src/main/java/org/n52/geoar/GeoARApplication.java
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.lang.Thread.UncaughtExceptionHandler;
import java.util.ArrayList;
import java.util.List;
import org.n52.geoar.utils.DataSourceLoggerFactory;
import org.n52.geoar.utils.DataSourceLoggerFactory.LoggerCallable;
import org.n52.geoar.newdata.PluginLogger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import android.app.Activity;
import android.app.Application;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.widget.Toast;

		Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {

			@Override
			public void uncaughtException(Thread thread, Throwable ex) {
				LOG.error("Uncaught exception in thread " + thread.getName(),
						ex);
				try {
					FileOutputStream fos = openFileOutput(STACKTRACE_FILENAME,
							Context.MODE_PRIVATE);
					ex.printStackTrace(new PrintStream(fos));
					fos.close();
				} catch (FileNotFoundException e) {
					e.printStackTrace();
				} catch (IOException e) {
					e.printStackTrace();
				}

				// fall back to standard handler
				if (defaultUncaughtExceptionHandler != null) {
					defaultUncaughtExceptionHandler.uncaughtException(thread,
							ex);
				}
			}
		});

		// ensure that plugins can access the main logger
		DataSourceLoggerFactory.setLoggerCallable(new LoggerCallable() {
			@Override
			public org.n52.geoar.utils.DataSourceLoggerFactory.Logger call(
					Class<?> clazz) {

				return new PluginLogger(clazz);
