package test;

import uk.ac.ic.doc.automed.editor.LogConsole;
import uk.ac.ic.doc.automed.p2p.AppToolKit;
import uk.ac.ic.doc.automed.p2p.protocol.P2PConstants;
import uk.ac.ic.doc.automed.util.Debugger;
import uk.ac.ic.doc.automed.util.LogOutputHandler;
import uk.ac.ic.doc.automed.util.LogServer;
import uk.ac.ic.doc.automed.util.Logger;


/**
 * TestLogServer.java<br><br>
 *
 *
 *
 * @author Duc M Le  <a href="mailto:dmle@doc.ic.ac.uk"><i>dmle@doc.ic.ac.uk</i></a>
 * @version 1.0
 * <br>Department of Computing, Imperial College
 */

public class TestLogServer {
  
  /**
   * Creates a new instance of TestLogServer
   */
  public TestLogServer() {
  }
  
  public static void main(String[] args) throws Exception {
    // start log server
//    LogServer ls = new LogServer();
//    System.out.println("Log server started.");
    
    LogConsole.main(args);
    
//    if (args.length < 1) {
//      System.out.println("Usage: java TestLogServer -d \"a.b [c.d ...]\"");
//      System.exit(0);
//    }
    
    AppToolKit.getConfig(P2PConstants.PEER_CFG_FILE);
    
    // start a logging process
    Logger.setOutputHandler(new LogOutputHandler(LogOutputHandler.CONSOLE +
        LogOutputHandler.REMOTE));
    
//    Debugger.setSectionDebugLevel(args);
    
    // try a log message
    System.out.println("Sending a test log message to server...");
    Logger.debug("TestLogServer", "main()", "Test logging " + System.currentTimeMillis());    
  }
}
