Skip to content

Instantly share code, notes, and snippets.

@fengyie007
Created November 21, 2013 04:45
Show Gist options
  • Save fengyie007/7576217 to your computer and use it in GitHub Desktop.
Save fengyie007/7576217 to your computer and use it in GitHub Desktop.
LoggerFactory
import org.slf4j.Logger;
/**
* @author Hardy Ferentschik
*/
public final class LoggerFactory {
public static Logger make() {
Throwable t = new Throwable();
StackTraceElement directCaller = t.getStackTrace()[1];
return org.slf4j.LoggerFactory.getLogger(directCaller.getClassName());
}
// private constructor to avoid instantiation
private LoggerFactory() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment