|
|
1.1 root 1: /* 1.1.1.6 ! root 2: Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved. 1.1 root 3: 1.1.1.6 ! root 4: Governed by the TrueCrypt License 2.8 the full text of which is contained in ! 5: the file License.txt included in TrueCrypt binary and source code distribution ! 6: packages. 1.1 root 7: */ 8: 9: #ifndef TC_HEADER_Platform_SystemLog 10: #define TC_HEADER_Platform_SystemLog 11: 12: #include "Platform/PlatformBase.h" 13: #include "Platform/StringConverter.h" 14: 15: namespace TrueCrypt 16: { 17: class SystemLog 18: { 19: public: 20: static void WriteDebug (const string &debugMessage); 21: static void WriteError (const string &errorMessage); 22: 23: static void WriteException (const exception &ex) 24: { 25: WriteError (string ("exception: ") + StringConverter::ToSingle (StringConverter::ToExceptionString (ex))); 26: } 27: 28: protected: 29: SystemLog (); 30: }; 31: 32: #ifdef DEBUG 33: # define tracelog_point do { stringstream s; s << (SRC_POS); SystemLog::WriteError (s.str()); } while (false) 34: # define tracelog_msg(stream_args) do { stringstream s; s << (SRC_POS) << ": " << stream_args; SystemLog::WriteError (s.str()); } while (false) 35: #else 36: # define tracelog_point 37: # define tracelog_msg(stream_args) while (false) { stringstream s; s << stream_args; } 38: #endif 39: 40: } 41: 42: #endif // TC_HEADER_Platform_SystemLog
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.