[ox/std] Add init hook to tracing system

This commit is contained in:
Gary Talent 2021-03-08 20:10:46 -06:00
parent 51387eea3a
commit 662c2e11de
3 changed files with 19 additions and 2 deletions

View File

@ -13,9 +13,14 @@
#include "trace.hpp"
extern "C"
extern "C" {
void oxTraceInitHook();
void oxTraceHook(const char *file, int line, const char *ch, const char *msg);
}
namespace ox::trace {
#if defined(OX_USE_STDLIB)
@ -65,4 +70,8 @@ void logError(const char *file, int line, Error err) {
}
}
void init() {
oxTraceInitHook();
}
}

View File

@ -128,6 +128,8 @@ using TraceStream = NullStream;
void logError(const char *file, int line, Error err);
void init();
}
#define oxLogError(err) ox::trace::logError(__FILE__, __LINE__, err)

View File

@ -6,8 +6,14 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
extern "C"
extern "C" {
void oxTraceInitHook() {
}
void oxTraceHook([[maybe_unused]] const char *file, [[maybe_unused]] int line,
[[maybe_unused]] const char *ch, [[maybe_unused]] const char *msg) {
}
}