diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2021-11-04 19:02:36 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-03-29 00:04:48 +0200 |
commit | 56a4c6c404fb3f58d2027d39f3acdab1490fc839 (patch) | |
tree | 6b17af490ee751e0e58413ae5d16fe26e4107792 /tracker-trackhat/camera.cpp | |
parent | 9681d6dd1b88dc04c5bca027a6c125a4276d19d5 (diff) |
tracker/trackhat: use logging handler for the C library
It's in my gitlab fork on fixes2 branch.
Diffstat (limited to 'tracker-trackhat/camera.cpp')
-rw-r--r-- | tracker-trackhat/camera.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tracker-trackhat/camera.cpp b/tracker-trackhat/camera.cpp index b662dcdf..35384b80 100644 --- a/tracker-trackhat/camera.cpp +++ b/tracker-trackhat/camera.cpp @@ -91,8 +91,21 @@ error: return {false, {}}; } +static void log_handler(const char* file, int line, const char* function, char level, const char* str, size_t len) +{ + if (level != 'E') + return; + char file_[128]; + snprintf(file_, std::size(file_), "trackhat/%s", file); + auto logger = QMessageLogger(file_, line, function).debug(); + logger << "tracker/trackhat:"; + logger.noquote() << QLatin1String(str, (int)len); +} + bool trackhat_camera::start(const pt_settings&) { + trackHat_SetDebugHandler(log_handler); + if constexpr(debug_mode) trackHat_EnableDebugMode(); else |