improved diagnostics

This commit is contained in:
Fischlurch 2011-11-07 00:50:03 +01:00
parent a88ccd219d
commit c8458ab397
3 changed files with 25 additions and 13 deletions

View file

@ -90,6 +90,9 @@ NOBUG_CPP_DEFINE_FLAG_PARENT ( fileheader_dbg, backend_dbg);
/** base of debug logging for the proc layer */
NOBUG_CPP_DEFINE_FLAG_PARENT ( proc_dbg, debugging);
NOBUG_CPP_DEFINE_FLAG_PARENT ( command_dbg, proc_dbg);
NOBUG_CPP_DEFINE_FLAG_PARENT ( session_dbg, proc_dbg);
NOBUG_CPP_DEFINE_FLAG_PARENT ( player_dbg, proc_dbg);
NOBUG_CPP_DEFINE_FLAG_PARENT ( engine_dbg, proc_dbg);
/** base of debug logging for the gui */
NOBUG_CPP_DEFINE_FLAG_PARENT ( gui_dbg, debugging);
/** base if debug logging for the support library */

View file

@ -215,6 +215,27 @@ namespace lumiera {
} // namespace lumiera
/******************************************************
* convenience shortcut for a sequence of catch blocks
* just logging and consuming an error. Typically
* this sequence will be used within destructors,
* which, by convention, must not throw
*/
#define ERROR_LOG_AND_IGNORE(_FLAG_,_OP_DESCR_) \
catch (std::exception& problem) \
{ \
const char* errID = lumiera_error(); \
WARN (_FLAG_, "%s failed: %s", _OP_DESCR_, problem.what()); \
TRACE (debugging, "Error flag was: %s", errID);\
} \
catch (...) \
{ \
const char* errID = lumiera_error(); \
ERROR (_FLAG_, "%s failed with unknown exception; " \
"error flag is: %s" \
, _OP_DESCR_, errID); \
}
/******************************************************

View file

@ -635,19 +635,7 @@ namespace engine {
{
for_each (entries_, verify_is_free);
}
catch (std::exception& problem)
{
const char* errID = lumiera_error();
const char* operation = "Shutdown of BufferProvider metadata store";
WARN (engine, "%s failed: %s", operation, problem.what());
TRACE (debugging, "Error flag was: %s", errID);
}
catch (...)
{
const char* errID = lumiera_error();
const char* operation = "Shutdown of BufferProvider metadata store";
ERROR (engine, "%s failed with unknown exception; error flag is: %s", operation, errID);
}
ERROR_LOG_AND_IGNORE (engine,"Shutdown of BufferProvider metadata store")
static void
verify_is_free (std::pair<HashVal, Entry> const& e)