Changeset 10511 for trunk/FACT++/src
- Timestamp:
- 05/02/11 19:05:09 (14 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/DimErrorRedirecter.cc
r10479 r10511 27 27 28 28 DimClient::addErrorHandler(this); 29 DimServer::addExitHandler(this); 29 30 } 30 31 … … 32 33 { 33 34 DimClient::addErrorHandler(0); 35 DimServer::addExitHandler(0); 34 36 } 35 37 36 38 void DimErrorRedirecter::errorHandler(int severity, int code, char *msg) 37 39 { 40 static const string id = "DIM|"; 41 38 42 switch (severity) 39 43 { 40 case DIM_FATAL: fMsg.Error(msg); return; 41 case DIM_ERROR: fMsg.Error(msg); return; 42 case DIM_WARNING: fMsg.Warn(msg); return; 43 case DIM_INFO: fMsg.Info(msg); return; 44 case DIM_FATAL: fMsg.Error(id+msg); break; 45 case DIM_ERROR: fMsg.Error(id+msg); break; 46 case DIM_WARNING: fMsg.Warn(id+msg); break; 47 case DIM_INFO: fMsg.Info(id+msg); break; 48 default: 49 stringstream str; 50 str << "DIM message with unknown severity (" << severity << "): "; 51 str << msg << " (" << code << ")"; 52 fMsg.Message(str); 53 break; 44 54 } 45 55 46 stringstream str; 47 str << "Severity of Dim message unknown(" << severity << "): "; 48 str << msg << "(" << code << ")"; 49 fMsg.Message(str); 56 if (severity==DIM_FATAL && code==DIMDNSDUPLC) 57 exitHandler(DIMDNSDUPLC); 50 58 51 59 /* -
trunk/FACT++/src/DimErrorRedirecter.h
r10384 r10511 2 2 #define FACT_DimErrorRedirecter 3 3 4 #include <di m.hxx>4 #include <dis.hxx> 5 5 6 6 class MessageImp; 7 7 8 class DimErrorRedirecter : public DimErrorHandler 8 class DimErrorRedirecter : public DimErrorHandler, public DimExitHandler 9 9 { 10 10 private: … … 14 14 15 15 void errorHandler(int severity, int code, char *msg); 16 void exitHandler(int code) { exit(code); } 16 17 17 18 public: 18 19 DimErrorRedirecter(MessageImp &imp); 19 20 ~DimErrorRedirecter(); 20 21 21 }; 22 22
Note:
See TracChangeset
for help on using the changeset viewer.