title: Java logger that automatically determines caller's class name
body: <pre><code>public static Logger getLogger() {
      final Throwable t = new Throwable();
      final StackTraceElement methodCaller = t.getStackTrace()[1];
      final Logger logger = Logger.getLogger(methodCaller.getClassName());
      logger.setLevel(ResourceManager.LOGLEVEL);
      return logger;
  }
  </code></pre>
  
  <p>This method would return a logger that knows the class it's logging for.
  Any ideas against it?</p>
  
  <p>Many years later: <a href="https://github.com/yanchenko/droidparts/blob/master/droidparts/src/org/droidparts/util/L.java" rel="noreferrer">https://github.com/yanchenko/droidparts/blob/master/droidparts/src/org/droidparts/util/L.java</a></p>