mirror of
https://github.com/paboyle/Grid.git
synced 2025-08-01 12:17:06 +01:00
demangle moves to logging
This commit is contained in:
15
lib/Log.cc
15
lib/Log.cc
@@ -31,8 +31,23 @@ directory
|
||||
/* END LEGAL */
|
||||
#include <Grid.h>
|
||||
|
||||
#include <cxxabi.h>
|
||||
|
||||
namespace Grid {
|
||||
|
||||
std::string demangle(const char* name) {
|
||||
|
||||
int status = -4; // some arbitrary value to eliminate the compiler warning
|
||||
|
||||
// enable c++11 by passing the flag -std=c++11 to g++
|
||||
std::unique_ptr<char, void(*)(void*)> res {
|
||||
abi::__cxa_demangle(name, NULL, NULL, &status),
|
||||
std::free
|
||||
};
|
||||
|
||||
return (status==0) ? res.get() : name ;
|
||||
}
|
||||
|
||||
GridStopWatch Logger::StopWatch;
|
||||
std::ostream Logger::devnull(0);
|
||||
|
||||
|
Reference in New Issue
Block a user