diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2020-04-03 10:38:53 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2020-04-03 10:38:53 -0400 |
commit | dc07509f296661cf7a4d4bceb88a1a897757de98 (patch) | |
tree | 07637f41c8dfbc4cab5cefa65749a8a748603c99 /indra/llcommon/llerror.h | |
parent | b793ab8619d8c52a099aa85fdd831990ca95c6f4 (diff) |
DRTVWR-476: Cherry-pick debug aids from commit 77b0c53 (fiber-mutex)
Diffstat (limited to 'indra/llcommon/llerror.h')
-rw-r--r-- | indra/llcommon/llerror.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h index 48162eca9e..3cdd051ac7 100644 --- a/indra/llcommon/llerror.h +++ b/indra/llcommon/llerror.h @@ -191,9 +191,9 @@ namespace LLError The classes CallSite and Log are used by the logging macros below. They are not intended for general use. */ - + struct CallSite; - + class LL_COMMON_API Log { public: @@ -202,8 +202,17 @@ namespace LLError static void flush(std::ostringstream* out, char* message); static void flush(std::ostringstream*, const CallSite&); static std::string demangle(const char* mangled); + /// classname<TYPE>() + template <typename T> + static std::string classname() { return demangle(typeid(T).name()); } + /// classname(some_pointer) + template <typename T> + static std::string classname(const T* ptr) { return demangle(typeid(*ptr).name()); } + /// classname(some_reference) + template <typename T> + static std::string classname(const T& obj) { return demangle(typeid(obj).name()); } }; - + struct LL_COMMON_API CallSite { // Represents a specific place in the code where a message is logged |