LogFile.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2009 by Ulrich Friedrich Klank <klank@in.tum.de>
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 3 of the License, or
00007  * (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016  */
00017 
00018 
00019 #ifdef LOGFILE
00020 #ifndef LOGFILE_H
00021 #define LOGFILE_H
00022 
00023 #include "XMLTag.h"
00024 
00025 #define XML_NODE_LOGFILE "LogFile"
00026 #define XML_NODE_LOGENTRY "LogEntry"
00027 
00028 #define XML_ATTRIBUTE_TIMESTAMP_LOG "Time"
00029 #define XML_ATTRIBUTE_CALLER    "Caller"
00030 #define XML_ATTRIBUTE_DURATION  "Duration"
00031 #define XML_ATTRIBUTE_SUCCESS   "Success"
00032 
00033 #define XML_NODE_ACTION_DESCRIPTION     "ActionName"
00034 #define XML_NODE_RELEATED_ELEM     "RelatedElem"
00035 
00036 
00037 namespace cop
00038 {
00043   class LogFile
00044   {
00045   public:
00046       LogFile(std::string filename);
00047       ~LogFile(void);
00048 
00060       void ReportError(std::string action_name,  std::string caller, long timestamp, double risk, Elem* relatedElem, std::string problemDescription);
00061       void ReportEvent(unsigned long ppid, std::string ppalg);
00071       void Log(std::string actionName,  std::string caller = "VisFinder", double duration_s = 0.0, double success = 1.0, Elem* relatedElem = NULL);
00072   #ifdef BOOST_THREAD
00073       void LogThread(std::string action_name,  std::string caller, double duration_s, double success, Elem* relatedElem);
00074   #endif /*BOOST_THREAD*/
00075 
00076   private:
00077       std::string m_filename;
00078   };
00079 }
00080 #endif /*LOGFILE_H*/
00081 #endif /*LOGFILE*/


cognitive_perception
Author(s): Ulrich F Klank
autogenerated on Mon Oct 6 2014 10:48:45