My Project
|
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 #pragma once 00029 00030 #include "Define.h" 00031 #include <fstream> 00032 #include <iostream> 00033 #include <eh.h> 00034 #include <process.h> 00035 #include <string> 00036 #include "ExceptionStackWalker.h" 00037 00038 namespace SallyAPI 00039 { 00040 namespace Exception 00041 { 00042 class DLL_API_SALLY CWinAPIExceptionHandler 00043 { 00044 private: 00045 static std::string m_strLogFolder; 00046 static std::string m_strVersionInfo; 00047 00048 static std::string GetCurrentTimestamp(); 00049 static void DumpExceptionDescr(std::ostream& output, DWORD code); 00050 static void DumpExceptCallsStack(std::ostream& output, PCONTEXT contextRecord); 00051 00052 CWinAPIExceptionHandler(); 00053 ~CWinAPIExceptionHandler(); 00054 public: 00055 static LONG CALLBACK Handler(PEXCEPTION_POINTERS p_info); 00056 static void InitExecptionWatcher(); 00057 static void SetVersionInfo(const std::string& versionInfo); 00058 static void SetLogFolder(const std::string& logFolder); 00059 }; 00060 } 00061 }