33 #ifndef __H__UG__COMMON__DEBUG_ID_H
34 #define __H__UG__COMMON__DEBUG_ID_H
145 std::map<uint32, int>::const_iterator it =
m_dbgLevels.find(debugIDhash);
147 else return (*it).second;
153 std::map<uint32, int>::iterator it =
m_dbgLevels.find(debugIDhash);
157 (*it).second = level;
210 std::stringstream str;
211 str <<
"DebugIDs:\n";
272 #ifdef UG_ENABLE_DEBUG_LOGS
273 class TemporaryDebugLevel
277 int m_prevDebugLevel;
279 TemporaryDebugLevel(
DebugID &debugID) : did(debugID)
285 TemporaryDebugLevel(DebugID &debugID,
int temporaryDebugLevel) : did(debugID)
292 TemporaryDebugLevel(DebugID &debugID, DebugID &debugSrc,
int diff=0) : did(debugID)
299 ~TemporaryDebugLevel()
304 void set(
int temporaryDebugLevel)
310 class TemporaryDebugLevel
314 TemporaryDebugLevel(DebugID &debugID){}
316 TemporaryDebugLevel(DebugID &debugID,
int temporaryDebugLevel){}
318 TemporaryDebugLevel(DebugID &debugID, DebugID &debugSrc,
int diff=0){}
320 ~TemporaryDebugLevel(){}
321 void set(
int temporaryDebugLevel){}
Definition: debug_id.h:94
Definition: debug_id.h:140
uint32 crc32(const char *str)
Calculates the crc32 for a null-terminated string.
Definition: crc32.cpp:39
DebugID LIB_DISC
Definition: debug_id.h:117
int get_debug_level() const
returns the debug level via GetDebugIDManager.
Definition: debug_id.h:236
DebugID LIB_GRID_REFINER
Definition: debug_id.h:116
DebugID LIB_DISC_NEWTON
Definition: debug_id.h:121
DebugID LIB_DISC_TRANSFER
Definition: debug_id.h:123
DebugID get_debug_id(const char *debugID) const
Definition: debug_id.h:182
bool set_debug_level(uint32 debugIDhash, int level)
sets the debug level of debugIDhash if registered to 'level'
Definition: debug_id.h:151
int get_debug_level(const char *debugID) const
returns the debug level of debugID, -1 if not found
Definition: debug_id.h:176
DebugID LIB_DISC_LINKER
Definition: debug_id.h:122
ugtypes::uint32_t uint32
Definition: types.h:116
bool set_debug_level(DebugID &debugID, int level)
sets the debug level of debugID if registered to 'level'
Definition: debug_id.h:196
DebugID LIB_ALG_LINEAR_SOLVER
Definition: debug_id.h:128
DebugID(const char *str)
registers the DebugID at DebugIDManager
Definition: debug_id.cpp:50
DebugID get_or_create_debug_id(const char *debugID)
Definition: debug_id.h:187
DebugID APP
Definition: debug_id.h:114
bool register_debug_id(const char *debugID)
Definition: debug_id.cpp:103
static DebugIDManager & instance()
returns a reference to the single instance of LogAssistant
Definition: debug_id.cpp:56
DebugID LIB_DISC_OPERATOR_INVERSE
Definition: debug_id.h:126
int get_debug_level(const DebugID &debugID) const
returns the debug level of debugID, -1 if not found
Definition: debug_id.h:171
DebugID LIB_ALG_VECTOR
Definition: debug_id.h:129
bool debug_id_registered(const char *debugIDname) const
returns true if there is a DebugID with name debugIDname
Definition: debug_id.h:166
int get_debug_level(uint32 debugIDhash) const
returns the debug level of debugIDhash, -1 if not found
Definition: debug_id.h:143
bool set_debug_level(int level)
sets the debug level via GetDebugIDManager.
Definition: debug_id.h:240
bool set_debug_levels(int lev)
sets the debug level of all registered debugIDs to 'lev'
Definition: debug_id.cpp:64
std::vector< std::string > m_dbgLevelIdentifiers
Definition: debug_id.h:227
std::map< uint32, int > m_dbgLevels
Definition: debug_id.h:228
DebugID LIB_DISC_ASSEMBLE
Definition: debug_id.h:118
DebugID LIB_ALG_LINEAR_OPERATOR
Definition: debug_id.h:127
DebugID LIB_ALG_MATRIX
Definition: debug_id.h:130
uint32 m_hash
Definition: debug_id.h:109
std::string get_registered_debug_IDs() const
returns a string describing all registered debugIDs.
Definition: debug_id.h:208
DebugID LIB_DISC_OUTPUT
Definition: debug_id.h:125
DebugID LIB_ALG_AMG
Definition: debug_id.h:131
DebugID LIB_DISC_D3F
Definition: debug_id.h:119
DebugID(uint32 hash)
Definition: debug_id.h:100
DebugID LIB_DISC_DISCRETE_FUNCTION
Definition: debug_id.h:124
DebugID LIB_GRID
Definition: debug_id.h:115
DebugIDManager & GetDebugIDManager()
Definition: debug_id.h:231
DebugID LIB_PCL
Definition: debug_id.h:132
DebugID LIB_DISC_MULTIGRID
Definition: debug_id.h:120
const std::vector< std::string > & get_registered_debug_IDs_arr() const
Definition: debug_id.h:217