diff options
| author | Jason Maskell <[email protected]> | 2016-05-31 11:24:52 +0200 |
|---|---|---|
| committer | Jason Maskell <[email protected]> | 2016-05-31 11:24:52 +0200 |
| commit | 999fd20ca96b8d44d3ce418f118fb3b846038978 (patch) | |
| tree | fc86969d4eb006f592560e7bd425b9a2db865be2 /common/Logger.h | |
| parent | Added path to opengl media search path. Removed commented out code left over ... (diff) | |
| download | waveworks_archive-999fd20ca96b8d44d3ce418f118fb3b846038978.tar.xz waveworks_archive-999fd20ca96b8d44d3ce418f118fb3b846038978.zip | |
Added support for RFC 104, the logging interface: https://docs.google.com/document/d/102b8k5pKYj9e-tMmG53aT5izur-qfUSPX1gBro4gN0Q/edit
Added a dumb implementation of the logger in the D3D11 sample.
Added a method to the WaveWorks API to allow the user to set (override) the internal logger with their own supplied nv::ILogger derived object.
Diffstat (limited to 'common/Logger.h')
| -rw-r--r-- | common/Logger.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/common/Logger.h b/common/Logger.h new file mode 100644 index 0000000..324b71e --- /dev/null +++ b/common/Logger.h @@ -0,0 +1,25 @@ +#pragma once + +namespace nv +{ + enum struct LogSeverity + { + kInfo = 0, // Message contains information about normal and expected behavior + kWarning = 1, // Message contains information about a potentially problematic situation + kError = 2, // Message contains information about a problem + kFatal = 3 // Message contains information about a fatal problem; program should be aborted + }; + + static const char * LogSeverityStrings[] = { "INFO", "WARNING", "ERROR", "FATAL" }; + + + // Note: Implementation of this interface must be thread-safe + class ILogger + { + public: + // �filename� is NULL and �linenumber� is 0 in release builds of GameWorks + virtual void log(const char* text, LogSeverity severity, const char* filename, int linenumber) = 0; + virtual void log(const wchar_t* text, LogSeverity severity, const wchar_t* filename, int linenumber) = 0; + }; +} + |