Skip to content

Commit 59a2a8d

Browse files
committed
Fix: debug logging value cached, environment not queried every time
1 parent f901d77 commit 59a2a8d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/native/src/frame_extractor.mm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <iostream>
88

99
#define DEBUG_LOG(msg) do { \
10-
if (std::getenv("VITEO_DEBUG")) { \
10+
if (debugLogging) { \
1111
std::cerr << "[viteo] " << msg << std::endl; \
1212
} \
1313
} while(0)
@@ -35,8 +35,12 @@
3535
size_t batch_index = 0;
3636

3737
bool isOpen = false;
38+
bool debugLogging = false;
3839

3940
Impl(size_t batch_size_param) : batch_size(batch_size_param) {
41+
if (std::getenv("VITEO_DEBUG")) {
42+
debugLogging = true;
43+
}
4044
DEBUG_LOG("Setting batch size to " << batch_size);
4145
}
4246

0 commit comments

Comments
 (0)