title: Get a dummy slf4j logger?
body: <p>Can I get a dummy logger from slf4j? (Think the null object design pattern.) If so, can someone provide an example? Or will I have to implement a custom logger if I want to do that?</p>
  
  <p>I'm hoping to write a function along the lines of</p>
  
  <pre><code>private Logger logger;
  static Logger nullLogger;
  
  static {
      nullLogger = getMeADummyLogger();
  }
  
  public Logger getLogger() {
      return this.logger == null ? nullLogger : this.logger;
  }
  
  // then, elsewhere:
  this.getLogger().info("something just happened");
  </code></pre>
  
  <p>and not get a <code>NullPointerException</code> on that last line if no logger has been set.</p>