Fission FSN
Loading...
Searching...
No Matches
fsIDebug.h
Go to the documentation of this file.
1/********************************************************************
2*
3* Created: 20/2/2014 11:40
4*
5* File: fsIDebug.h
6*
7* Author: Mick Waites
8*
9* Purpose: Interface for debug output
10*
11*********************************************************************/
12
13#ifndef fsIDebughdr
14#define fsIDebughdr
15
16#include <vector>
17
18#include <fsCore/fsBaseTypes.h>
21
22#include "../../fsStr.h"
23#include "../fsCResourceName.h"
24
25class fsIDebug : public fsIMessageListener, public fsTSingletonBackend<fsIDebug>
26{
27 friend class fsTSingletonBackend<fsIDebug>;
28
29public:
30
31 fsS32 logCountGet() const { return mLogStrings.size(); }
32 const std::vector<fsStr>& logsGet();
33
34 virtual fsStr formattedFsStrGet(const fsChar* pFmtStr, ...) = 0;
35 void logFileWrite();
36
37 void errorStringInsert(fsStr pLogStr);
38 void logStringInsert(fsStr pLogStr);
39
40 // Lets an unattended runner (e.g. the auto-test manager) suppress the warning-box
41 void dialogsSuppressSet(fsBool pSuppress) { mDialogsSuppressed = pSuppress; }
43
47
48 virtual ~fsIDebug();
49
50protected:
51
53
54 fsIDebug();
55
56 std::vector<fsStr> mLogStrings;
57 std::vector<fsStr> mErrorStrings;
58
59 // Tracks the last inserted line across flushes, so repeats still dedupe even
60 // when the buffer was just cleared out from under it (e.g. a flushed error).
62
64
65 // Bytes in the live log, tracked as we append so the size cap costs no file stat.
67
68
69private:
70
71 const fsCResourceName mLogFileResource;
72};
73
74#endif
Definition fsCResourceName.h:32
Definition fsCUniqueId.h:21
Definition fsIDebug.h:26
fsStr mLastLogStr
Definition fsIDebug.h:61
const std::vector< fsStr > & logsGet()
Definition fsIDebug.cpp:131
void logFileWrite()
Definition fsIDebug.cpp:141
virtual ~fsIDebug()
Definition fsIDebug.cpp:228
fsS32 logCountGet() const
Definition fsIDebug.h:31
virtual fsStr formattedFsStrGet(const fsChar *pFmtStr,...)=0
std::vector< fsStr > mErrorStrings
Definition fsIDebug.h:57
fsBool dialogsSuppressedGet() const
Definition fsIDebug.h:42
fsStr::sizeT mLogFileBytes
Definition fsIDebug.h:66
fsBool mDialogsSuppressed
Definition fsIDebug.h:63
void listenersDeregisterDo()
Definition fsIDebug.cpp:97
void errorStringInsert(fsStr pLogStr)
Definition fsIDebug.cpp:185
static fsIDebug * backendInstanceCreate()
Definition fsIDebug.cpp:136
fsIDebug()
Definition fsIDebug.cpp:220
void logStringInsert(fsStr pLogStr)
Definition fsIDebug.cpp:170
void listenersRegisterDo()
Definition fsIDebug.cpp:84
fsBool messageProcessDo(const fsCUniqueId &pMessageType, const fsIMessageDispatcher::sMessageParameters &pParam)
Definition fsIDebug.cpp:111
std::vector< fsStr > mLogStrings
Definition fsIDebug.h:56
void dialogsSuppressSet(fsBool pSuppress)
Definition fsIDebug.h:41
fsIMessageListener(fsS32 pPriority)
Definition fsIMessageListener.cpp:41
Definition fsStr.h:23
std::string::size_type sizeT
Definition fsStr.h:26
bool fsBool
Definition fsBaseTypes.h:26
int fsS32
Definition fsBaseTypes.h:20
char fsChar
Definition fsBaseTypes.h:12
Definition fsIMessageDispatcher.h:32