Skip to content

Commit 83159a0

Browse files
author
Comma Device
committed
THNEED_DEBUG env var support
1 parent 6a07288 commit 83159a0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

selfdrive/modeld/thneed/thneed.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,12 @@ Thneed::Thneed(bool do_clinit) {
223223
record = THNEED_RECORD;
224224
timestamp = -1;
225225
g_thneed = this;
226+
char *thneed_debug_env = getenv("THNEED_DEBUG");
227+
if (thneed_debug_env != NULL) {
228+
int thneed_debug_level = atoi(thneed_debug_env);
229+
record |= (thneed_debug_level >= 1) ? THNEED_DEBUG : 0;
230+
record |= (thneed_debug_level >= 2) ? THNEED_VERBOSE_DEBUG : 0;
231+
}
226232
}
227233

228234
void Thneed::stop() {

0 commit comments

Comments
 (0)