Created
November 21, 2013 04:45
-
-
Save fengyie007/7576217 to your computer and use it in GitHub Desktop.
LoggerFactory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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