/*
 * Copyright (c) 2007 Stephan D. Cote' - All rights reserved.
 * 
 * This program and the accompanying materials are made available under the 
 * terms of the MIT License which accompanies this distribution, and is 
 * available at http://creativecommons.org/licenses/MIT/
 *
 * Contributors:
 *   Stephan D. Cote 
 *      - Initial concept and initial implementation
 */
package coyote.loader.log;

import java.net.URI;
import java.net.URISyntaxException;

import coyote.loader.cfg.Config;


/**
 * The NullLogger class models a logger that does nothing.
 * 
 * <p>This allows calls to a logger to do nothing. It is helpful in creating an 
 * instance of this class as opposed to setting an object attribute to null so 
 * the caller does not have to always check for a null reference after calling 
 * an accessor method to get a logger.</p>
 * 
 * <p>See Martin Fowler's refactoring books (Refactoring to Patterns) or 
 * (Refactoring: Improving the Design of Existing Code) for details on using 
 * Null Objects in software.</p>
 * 
 * @author Stephan D. Cote'
 */
public class NullLogger implements Logger {

  private static final String NULL_URI = "null:///";




  /**
   * @see coyote.loader.log.Logger#append(java.lang.String, java.lang.Object, java.lang.Throwable)
   */
  public void append( final String category, final Object event, final Throwable cause ) {}




  /**
   * @see coyote.loader.log.Logger#disable()
   */
  public void disable() {}




  /**
   * @see coyote.loader.log.Logger#enable()
   */
  public void enable() {}




  /**
   * @see coyote.loader.log.Logger#getConfig()
   */
  public Config getConfig() {
    return null;
  }




  /**
   * @see coyote.loader.log.Logger#getMask()
   */
  public long getMask() {
    return 0;
  }




  /**
   * @see coyote.loader.log.Logger#getTarget()
   */
  public URI getTarget() {
    try {
      return new URI( NULL_URI );
    } catch ( final URISyntaxException e ) {
      System.out.println( e.getMessage() );
    }
    return null;
  }




  /**
   * @see coyote.loader.log.Logger#initialize()
   */
  public void initialize() {}




  /**
   * @see coyote.loader.log.Logger#isLocked()
   */
  public boolean isLocked() {
    return false;
  }




  /**
   * @see coyote.loader.log.Logger#setConfig(coyote.loader.cfg.Config)
   */
  public void setConfig( final Config cfg ) {}




  /**
   * @see coyote.loader.log.Logger#setLocked(boolean)
   */
  public void setLocked( final boolean flag ) {}




  /**
   * @see coyote.loader.log.Logger#setMask(long)
   */
  public void setMask( final long mask ) {}




  /**
   * @see coyote.loader.log.Logger#setTarget(java.net.URI)
   */
  public void setTarget( final URI uri ) {}




  /**
   * @see coyote.loader.log.Logger#startLogging(java.lang.String)
   */
  public void startLogging( final String category ) {}




  /**
   * @see coyote.loader.log.Logger#stopLogging(java.lang.String)
   */
  public void stopLogging( final String category ) {}




  /**
   * @see coyote.loader.log.Logger#terminate()
   */
  public void terminate() {}

}

@@ -1033,44 +1033,12 @@
 /p%3E%0A
- * %0A * @author Stephan D. Cote'%0A
  */%0A
+
 publ
@@ -1238,32 +1238,44 @@
 hrowable)%0A   */%0A
+  @Override%0A
   public void ap
@@ -1403,32 +1403,44 @@
 disable()%0A   */%0A
+  @Override%0A
   public void di
@@ -1502,32 +1502,44 @@
 #enable()%0A   */%0A
+  @Override%0A
   public void en
@@ -1603,32 +1603,44 @@
 tConfig()%0A   */%0A
+  @Override%0A
   public Config 
@@ -1727,32 +1727,44 @@
 getMask()%0A   */%0A
+  @Override%0A
   public long ge
@@ -1846,32 +1846,44 @@
 tTarget()%0A   */%0A
+  @Override%0A
   public URI get
@@ -2109,32 +2109,44 @@
 tialize()%0A   */%0A
+  @Override%0A
   public void in
@@ -2213,32 +2213,44 @@
 sLocked()%0A   */%0A
+  @Override%0A
   public boolean
@@ -2364,32 +2364,44 @@
 g.Config)%0A   */%0A
+  @Override%0A
   public void se
@@ -2493,32 +2493,44 @@
 (boolean)%0A   */%0A
+  @Override%0A
   public void se
@@ -2619,32 +2619,44 @@
 ask(long)%0A   */%0A
+  @Override%0A
   public void se
@@ -2750,32 +2750,44 @@
 .net.URI)%0A   */%0A
+  @Override%0A
   public void se
@@ -2888,32 +2888,44 @@
 g.String)%0A   */%0A
+  @Override%0A
   public void st
@@ -3036,32 +3036,44 @@
 g.String)%0A   */%0A
+  @Override%0A
   public void st
@@ -3173,16 +3173,28 @@
 )%0A   */%0A
+  @Override%0A
   public
@@ -3215,10 +3215,303 @@
 e() %7B%7D%0A%0A
+%0A%0A%0A  /**%0A   * @see coyote.loader.log.Logger#getFormatter()%0A   */%0A  @Override%0A  public Formatter getFormatter() %7B%0A    return null;%0A  %7D%0A%0A%0A%0A%0A  /**%0A   * @see coyote.loader.log.Logger#setFormatter(coyote.loader.log.Formatter)%0A   */%0A  @Override%0A  public void setFormatter( Formatter formatter ) %7B%7D%0A%0A
 %7D%0A

implement formatter accessors