/
githubmirror
/
omim
Обзор
Документация
Войти
/
githubmirror
/
omim
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
base/base.cpp
31 строка
718 B
Mikhail Gorbushin
[base] Add TID to message at CHECK/ASSERT
03 дек 2019, 12:49
03 дек 2019, 12:49
406e1b4
Код
Авторство
О чём код?
#include "base/base.hpp" #include "base/assert.hpp" #include "base/exception.hpp" #include "base/logging.hpp" #include "base/src_point.hpp" #include "std/target_os.hpp" #include <iostream> namespace base { bool OnAssertFailedDefault(SrcPoint const & srcPoint, std::string const & msg) { auto & logger = LogHelper::Instance(); std::cerr << "TID(" << logger.GetThreadID() << ") ASSERT FAILED" << std::endl << srcPoint.FileName() << ":" << srcPoint.Line() << std::endl << msg << std::endl; return true; } AssertFailedFn OnAssertFailed = &OnAssertFailedDefault; AssertFailedFn SetAssertFunction(AssertFailedFn fn) { std::swap(OnAssertFailed, fn); return fn; } } // namespace base