/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : eventLogServer.cc                                             */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 02/07/2000                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
#include <stdio.h>
#include "EventLogServer.h"
#include "Syslog.h"
#include "System.h"

int main(int argc, char **argv)
{
  if (argc != 1) {
    Syslog::write("usage: %s\n", argv[0]);
    return -1;
  }

  //////////////////////////////////////////////////////////////////
  // Build file name and open the file
  char *auvLogDir = getenv(AuvLogDirName);

  if (auvLogDir == 0) {

    Syslog::write("DataLog::DataLog() - environment variable %s not set\n",
		  AuvLogDirName);
    exit(1);
  }

  char filename[256];
  sprintf(filename, "%s/%s/%s.log", auvLogDir, LatestLogDirName, "events");

  EventLogServer *server = new EventLogServer(filename, True);

  server->run();

  delete server;
  return 0;
}

