----------------------- Logger::ProcessAssert break on non shipping builds
| 180 | // break on non shipping builds |
| 181 | // |
| 182 | void Logger::ProcessAssert(bool const condition, std::string const& caller, std::string const& msg) |
| 183 | { |
| 184 | if (!condition) |
| 185 | { |
| 186 | Log("[ASSERT] " + caller + std::string(" > ") + msg, LogLevel::Warning, true); |
| 187 | |
| 188 | // break but don't exit |
| 189 | #ifdef PLATFORM_x32 |
| 190 | __asm { int 3 }; |
| 191 | #else // PLATFORM_x64 |
| 192 | __debugbreak(); |
| 193 | #endif |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | #endif // ET_SHIPPING |
| 198 | |
| 199 | |
| 200 | //----------------------- |
| 201 | // Logger::CheckBreak |
| 202 | // |
| 203 | // Breaks on debug builds, exits otherwise |
| 204 | // |
| 205 | void Logger::CheckBreak(LogLevel level) |
| 206 | { |
| 207 | if ((m_BreakBitField&level) == level) |
| 208 | { |
| 209 | #if ET_DEBUG |
| 210 | |
| 211 | #ifdef PLATFORM_x32 |
| 212 | __asm { int 3 }; |
| 213 | #else // PLATFORM_x64 |
| 214 | __debugbreak(); |
| 215 | #endif // PLATFORM_x32 |
| 216 | |
| 217 | #else // not debug |
| 218 | exit(-1); |
| 219 | #endif // ET_DEBUG |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | |
| 224 | |
| 225 | //Console stuff |
| 226 | //*************** |
| 227 | Logger::ConsoleLogger::ConsoleLogger() |
| 228 | { |
| 229 | // Check if we already have a console attached |
| 230 | //if (!_isatty(_fileno(stdout))) |
| 231 | //{ |
| 232 | // // if not, create one |
| 233 | // if (!AllocConsole()) |
| 234 | // { |
| 235 | // std::cout << "Warning: Could not attach to console" << std::endl; |
| 236 | // CheckBreak(Error); |
| 237 | // return; |
| 238 | // } |
| 239 | //} |
nothing calls this directly
no outgoing calls
no test coverage detected