resonance 1.0.1
Loading...
Searching...
No Matches
dbg.h
Go to the documentation of this file.
1#pragma once
2
3class HxStr;
4namespace Rnd {
5class Stream;
6} // namespace Rnd
7
9typedef void (*FailReportProc)(const char *pszMessage);
10
12typedef void (*FailAbortProc)();
13
14namespace Rnd {
15
33class Dbg {
34public:
41 Dbg();
42
49
61 void OpenLog(const HxStr &path);
62
71 void CloseLog();
72
82 void SetNotify(FailReportProc pfnReport);
83
93 void Notify(const char *pszFormat, ...);
94
103 Dbg *Format(const char *pszFormat, ...);
104
115 Dbg *Print(const char *pszText);
116
126
127private:
128 FailReportProc mReportProc; // +0x04
129 int mInitializedFlag; // +0x08 set to 1 by the constructor and never read
130
131public:
141
142private:
143 Stream *mLogStream; // +0x10
144};
145
152extern Dbg TheDbg;
153
154} // namespace Rnd
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
Sink that the engine formats its diagnostic and failure text into.
Definition dbg.h:33
~Dbg()
Delete the log stream, without flushing it first.
Dbg * Print(const char *pszText)
Write literal text.
FailAbortProc mAbortProc
Handler that finishes a failure report.
Definition dbg.h:125
void Notify(const char *pszFormat,...)
Format a failure message and pass it to the installed report handler.
Dbg()
Install the built-in report handler with no log open and a dump level of zero.
int mDumpLevel
Detail level a dump routine tests before writing its optional sections.
Definition dbg.h:140
Dbg * Format(const char *pszFormat,...)
Format text into the secondary buffer without dispatching it.
void SetNotify(FailReportProc pfnReport)
Install the handler that receives formatted failure text.
void CloseLog()
Flush and delete the log stream, if one is open.
void OpenLog(const HxStr &path)
Replace the log with a file opened for writing.
Byte stream that every renderer object serialises itself through.
Definition stream.h:31
void(* FailReportProc)(const char *pszMessage)
Receives one fully formatted failure message.
Definition dbg.h:9
void(* FailAbortProc)()
Finishes a failure report.
Definition dbg.h:12
The rendering engine.
Definition animhelper.h:3
Dbg TheDbg
Engine-wide failure sink.