Update README.md
[nemesis.git] / Platform / SystemLog.h
1 /*
2  Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
3
4  Governed by the TrueCrypt License 3.0 the full text of which is contained in
5  the file License.txt included in TrueCrypt binary and source code distribution
6  packages.
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 page took 0.027819 seconds and 3 git commands to generate. Download a nemesis OSX (sierra+high sierra, tested/working) binary, with fuse-ext3 via e2fsprogs, at this link. application and installer are signed by screwjack, llc. must install fuse with macFUSE layer first.