# Trace.cc

Go to the documentation of this file.

    00001 // ----------------------------------------------------------------------------
    00002 // CERTI - HLA RunTime Infrastructure
    00003 // Copyright (C) 2002, 2003  ONERA
    00004 //
    00005 // This file is part of CERTI
    00006 //
    00007 // CERTI is free software ; you can redistribute it and/or modify
    00008 // it under the terms of the GNU General Public License as published by
    00009 // the Free Software Foundation ; either version 2 of the License, or
    00010 // (at your option) any later version.
    00011 //
    00012 // CERTI is distributed in the hope that it will be useful,
    00013 // but WITHOUT ANY WARRANTY ; without even the implied warranty of
    00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    00015 // GNU General Public License for more details.
    00016 //
    00017 // You should have received a copy of the GNU General Public License
    00018 // along with this program ; if not, write to the Free Software
    00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    00020 //
    00021 // $Id: Trace.cc,v 3.6 2003/07/07 23:05:26 breholee Exp $
    00022 // ----------------------------------------------------------------------------
    00023
    00024 #include <config.h>
    00025 #include "Trace.hh"
    00026
    00027 #include <time.h>
    00028
    00029 namespace certi {
    00030 namespace rtig {
    00031
    00032 Trace::Trace()
    00033 {
    00034     f_trace = fopen(NOM_FICHIER_TRACE, "w");
    00035     if (f_trace == NULL)
    00036         printf("GTr: impossible ouvrir fichier trace %s\n", NOM_FICHIER_TRACE);
    00037 }
    00038
    00039 Trace::~Trace()
    00040 {
    00041     if (f_trace) fclose(f_trace);
    00042 }
    00043
    00044 void Trace::write(const char *s)
    00045 {
    00046     if (f_trace) fprintf(f_trace, "%ld %s\n", time(0), s);
    00047 }
    00048
    00049 }}
    00050
    00051 // $Id: Trace.cc,v 3.6 2003/07/07 23:05:26 breholee Exp $