| 249 | } |
| 250 | |
| 251 | void MException::Log(const LogType type, const Char* target) |
| 252 | { |
| 253 | #if LOG_ENABLE |
| 254 | // Log inner exceptions chain |
| 255 | MException* inner = InnerException; |
| 256 | while (inner) |
| 257 | { |
| 258 | const Char* stackTrace = inner->StackTrace.HasChars() ? *inner->StackTrace : TEXT("<empty>"); |
| 259 | Log::Logger::Write(LogType::Warning, String::Format(TEXT("Inner exception. {0}\nStack strace:\n{1}\n"), inner->Message, stackTrace)); |
| 260 | inner = inner->InnerException; |
| 261 | } |
| 262 | |
| 263 | // Send stack trace only to log file |
| 264 | const Char* stackTrace = StackTrace.HasChars() ? *StackTrace : TEXT("<empty>"); |
| 265 | const String info = target && *target ? String::Format(TEXT("Exception has been thrown during {0}."), target) : TEXT("Exception has been thrown."); |
| 266 | Log::Logger::Write(LogType::Warning, String::Format(TEXT("{0} {1}\nStack strace:\n{2}"), info, Message, stackTrace)); |
| 267 | Log::Logger::Write(type, String::Format(TEXT("{0}\n{1}"), info, Message)); |
| 268 | #endif |
| 269 | } |
| 270 | |
| 271 | MType* MProperty::GetType() const |
| 272 | { |
no test coverage detected