package me.allenz.androidapplog;

import java.lang.Thread.UncaughtExceptionHandler;

public class UncaughtExceptionLogger implements UncaughtExceptionHandler {

	private UncaughtExceptionHandler mDefaultExceptionHandler;

	public UncaughtExceptionLogger() {
		this(Thread.getDefaultUncaughtExceptionHandler());

	}

	public UncaughtExceptionLogger(
			final UncaughtExceptionHandler uncaughtExceptionHandler) {
		this.mDefaultExceptionHandler = uncaughtExceptionHandler;
	}

	@Override
	public void uncaughtException(final Thread thread, final Throwable ex) {
		final Logger logger = LoggerFactory.getLogger(ex.getStackTrace()[0]
				.getClassName());
		logger.error(ex);
		if (mDefaultExceptionHandler != null) {
			mDefaultExceptionHandler.uncaughtException(thread, ex);
		}
	}

}

@@ -774,10 +774,113 @@
 %09%09%7D%0A%09%7D%0A%0A
+%09public UncaughtExceptionHandler getDefaultExceptionHandler() %7B%0A%09%09return mDefaultExceptionHandler;%0A%09%7D%0A%0A
 %7D%0A

add getDefaultExceptionHandler() for class UncaughtExceptionLogger