Slice Tools libFoundation |
LogMsg.hhGo to the documentation of this file.00001 // $Id: LogMsg.hh,v 1.1 2005/07/29 02:55:15 mschatz Exp $ 00002 00005 00006 #ifndef LOGMSG_HH 00007 #define LOGMSG_HH 1 00008 00009 #include <string> 00010 #include <time.h> 00011 #include "MessageLevel.hh" 00012 00013 class Logger; 00014 class CategoryInformation; 00015 #include "CategoryInformation.hh" 00016 00018 00021 class LogMsg 00022 { 00023 public: 00024 LogMsg(std::string msg, 00025 CategoryInformation * category, 00026 MessageLevel messageLevel, 00027 int pid, 00028 bool forceLog = false); 00029 00030 // Getters and Setters 00031 void setMsgCount(int msgCount); 00032 00033 int getPID() const; 00034 int getMsgCount() const; 00035 time_t getTimeStamp() const; 00036 MessageLevel getMessageLevel() const; 00037 std::string getMessageLevelStr() const; 00038 std::string getCategory() const; 00039 00040 const std::string & getMsg() const; 00041 00042 // Message Level testing 00043 bool doLog() const; 00044 bool isFatal() const; 00045 00046 private: 00048 std::string m_msg; 00049 00051 CategoryInformation * m_category; 00052 00054 time_t m_timeStamp; 00055 00057 MessageLevel m_messageLevel; 00058 00060 bool m_doLog; 00061 00063 int m_pid; 00064 00066 int m_msgCount; 00067 }; 00068 00069 std::ostream & operator<< (std::ostream & os, const LogMsg & logMsg); 00070 00071 #endif |