Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
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
00075
00076 private:
00077 std::string m_filename;
00078 };
00079 }
00080 #endif
00081 #endif