package talk;

import java.io.*;

/** The Logger class has static methods implementing a simple debug
    log functionality that can be turned off in production code.
*/
public class Logger {
  static {
    InputStream ins = Logger.class.getResourceAsStream("logger.properties");
    
    if (ins != null) {
      try {
	java.util.logging.LogManager lman =
	  java.util.logging.LogManager.getLogManager();
	lman.readConfiguration(ins);
      }
      catch (IOException e) {
	System.err.println("Couldn't read logger.properties");
      }
    } else {
      System.err.println("Couldn't read logger.properties");
    }
  }

  public static java.util.logging.Logger getLogger()
  {
    return java.util.logging.Logger.getLogger("talk");
  }

  public static java.util.logging.Logger getLogger(String name)
  {
    return java.util.logging.Logger.getLogger(name);
  }
    
}
