Fission FSN
Loading...
Searching...
No Matches
fsLog.h
Go to the documentation of this file.
1/********************************************************************
2*
3* File: fsLog.h
4*
5* Purpose: Log debug output to a text file.
6*
7*********************************************************************/
8
9#ifndef fsLoghdr
10#define fsLoghdr
11
12#include <fsCore/fsBaseTypes.h>
13
14#if defined fsFRAMEWORK_CX
16#elif defined fsFRAMEWORK_AX
18#elif defined fsFRAMEWORK_MG
20#elif defined fsFRAMEWORK_RL
22#elif defined fsFRAMEWORK_BF
24#else
25 #error Unhandled platform.
26#endif
27
28#include "fsDebugHelpers.h"
29#include "fsIDebug.h"
30
31// Info-level messages only exist at the verbose (dev) tier.
32#if fsLOG_VERBOSE
33
34 #define fsLogMsg( pFmtStr, ... ) \
35 { \
36 fsStr logStr( "FISSION_LOG(" ); logStr += __FUNCTION__; logStr += ") "; \
37 logStr += variableArguementListCompound(pFmtStr, ##__VA_ARGS__);\
38 fsCLogMsg(logStr); \
39 }
40
41#else
42
43 #define fsLogMsg( ... )
44
45#endif
46
47// Errors are always live - lite tier just skips the console-formatting blank lines.
48#if fsLOG_VERBOSE
49
50 #define fsLogError( pFmtStr, ... ) \
51 { \
52 fsStr logStr( "FISSION_ERROR(" ); logStr += __FUNCTION__; logStr += ") "; \
53 logStr += variableArguementListCompound(pFmtStr, ##__VA_ARGS__);\
54 fsCLogError(logStr); \
55 }
56
57#else
58
59 #define fsLogError( pFmtStr, ... ) \
60 { \
61 fsStr logStr( "FISSION_ERROR(" ); logStr += __FUNCTION__; logStr += ") "; \
62 logStr += variableArguementListCompound(pFmtStr, ##__VA_ARGS__);\
63 fsCLogError(logStr); \
64 }
65
66#endif
67
68// An info-level line that hits the disk immediately - down the msg path, not the
69// error one, so it neither pops the debug box nor queues as an error.
70#define fsLogFlushMsg( pFmtStr, ... ) \
71 { \
72 fsStr logStr( "FISSION_LOG(" ); logStr += __FUNCTION__; logStr += ") "; \
73 logStr += variableArguementListCompound(pFmtStr, ##__VA_ARGS__);\
74 fsCLogMsgFlush(logStr); \
75 }
76
77#endif