Skip to content

Instantly share code, notes, and snippets.

@pianovwork
Created March 30, 2016 23:05
Show Gist options
  • Save pianovwork/b57b7335069649e33df7707f4ada0193 to your computer and use it in GitHub Desktop.
Save pianovwork/b57b7335069649e33df7707f4ada0193 to your computer and use it in GitHub Desktop.
Smart Logger Factory
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