/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
XBT_LOG_EXTERNAL_CATEGORY(xbt);
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_exception, xbt, "Exceptions");
XBT_LOG_EXTERNAL_CATEGORY(xbt);
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_exception, xbt, "Exceptions");
if (with_context != nullptr)
XBT_LOG(prio, "%s %s by %s/%d: %s",
context, name.get(),
if (with_context != nullptr)
XBT_LOG(prio, "%s %s by %s/%d: %s",
context, name.get(),
XBT_LOG(prio, "%s %s: %s", context, name.get(), exception.what());
// Do we have a backtrace?
XBT_LOG(prio, "%s %s: %s", context, name.get(), exception.what());
// Do we have a backtrace?
auto backtrace = simgrid::xbt::resolveBacktrace(
with_context->backtrace().data(), with_context->backtrace().size());
for (std::string const& s : backtrace)
auto backtrace = simgrid::xbt::resolveBacktrace(
with_context->backtrace().data(), with_context->backtrace().size());
for (std::string const& s : backtrace)