Created
March 30, 2016 23:05
-
-
Save pianovwork/b57b7335069649e33df7707f4ada0193 to your computer and use it in GitHub Desktop.
Smart Logger Factory
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
public final class SmartLoggerFactory { | |
public static org.slf4j.Logger getLogger() { | |
final Throwable ex = new Throwable(); | |
ex.fillInStackTrace(); | |
String clazz = ex.getStackTrace()[1].getClassName(); | |
return org.slf4j.LoggerFactory.getLogger(clazz); | |
} | |
private SmartLoggerFactory() { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment