| 13 | } |
| 14 | |
| 15 | void SDR::Error::Print(const Exception& error) |
| 16 | { |
| 17 | auto showstack = !ContextStack.empty(); |
| 18 | |
| 19 | if (showstack) |
| 20 | { |
| 21 | auto tabsize = 4; |
| 22 | std::string tabs; |
| 23 | |
| 24 | for (const auto& str : ContextStack) |
| 25 | { |
| 26 | Log::Warning("%s\"%s\"\n%s{\n", tabs.c_str(), str.c_str(), tabs.c_str()); |
| 27 | tabs.append(tabsize, ' '); |
| 28 | } |
| 29 | |
| 30 | Log::Warning("%s%s\n", tabs.c_str(), error.Description.c_str()); |
| 31 | |
| 32 | for (const auto& str : ContextStack) |
| 33 | { |
| 34 | tabs.resize(tabs.size() - tabsize); |
| 35 | Log::Warning("%s}\n", tabs.c_str()); |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | else |
| 40 | { |
| 41 | Log::Warning(PrintFormat, error.Description.c_str()); |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | SDR::Error::ScopedContext::ScopedContext(std::string&& str) |
| 46 | { |