diff options
author | Chris Robinson <[email protected]> | 2023-04-30 17:46:18 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-04-30 17:46:18 -0700 |
commit | 22077687cf4b9fdfd29d78debc2daf044deee81d (patch) | |
tree | fc9aab402ea9e33f7cec2e1ef1dfa98203665578 /alc/context.h | |
parent | f2a0df87916de7b9fa8b65a52814c9a09fc6bee9 (diff) |
Implement debug log storage
Diffstat (limited to 'alc/context.h')
-rw-r--r-- | alc/context.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/alc/context.h b/alc/context.h index b5ee440b..031e061e 100644 --- a/alc/context.h +++ b/alc/context.h @@ -2,6 +2,7 @@ #define ALC_CONTEXT_H #include <atomic> +#include <deque> #include <memory> #include <mutex> #include <stdint.h> @@ -66,6 +67,23 @@ enum class DebugSeverity : uint8_t { }; constexpr uint DebugSeverityCount{4}; +struct LogEntry { + const DebugSource mSource; + const DebugType mType; + const DebugSeverity mSeverity; + const uint mId; + + std::string mMessage; + + template<typename T> + LogEntry(DebugSource source, DebugType type, uint id, DebugSeverity severity, T&& message) + : mSource{source}, mType{type}, mSeverity{severity}, mId{id} + , mMessage{std::forward<T>(message)} + { } + LogEntry(const LogEntry&) = default; + LogEntry(LogEntry&&) = default; +}; + struct SourceSubList { uint64_t FreeMask{~0_u64}; @@ -127,6 +145,7 @@ struct ALCcontext : public al::intrusive_ref<ALCcontext>, ContextBase { ALDEBUGPROCSOFT mDebugCb{}; void *mDebugParam{nullptr}; std::vector<uint> mDebugFilters; + std::deque<LogEntry> mDebugLog; ALlistener mListener{}; |