How to disable log in NPU?

Hi all,

I’m using NU toolkit to run my tensorflow model. When using vsi_nn_ConvertTensorToData it prints out some info with vsi_nn_LogMsg.

How can I disable this log prints ?

Thank you very much

@ptphucbk You need to clone aml_npu_app in our gitlab. Then follow my patch . finall rebuild you the share library.

diff --git a/detect_library/source_code/detect_log.c b/detect_library/source_code/detect_log.c
index 983845c..4405ef6 100644
--- a/detect_library/source_code/detect_log.c
+++ b/detect_library/source_code/detect_log.c
@@ -16,14 +16,14 @@ void det_set_log_level(det_debug_level_t level,det_log_format_t output_format)
         LOGW("Set log level by environmental variable.level=%d",g_log_level);
     } else {
         g_log_level = level;
-        LOGW("Set log level=%d",g_log_level);
+//        LOGW("Set log level=%d",g_log_level);^M
-    LOGW("output_format not support Imperfect, default to DET_LOG_TERMINAL");
+  //  LOGW("output_format not support Imperfect, default to DET_LOG_TERMINAL");^M
     char* vsi_log = getenv("VSI_NN_LOG_LEVEL");
     if (!vsi_log) {
         setenv("VSI_NN_LOG_LEVEL", "1", 0);
-        LOGW("Not exist VSI_NN_LOG_LEVEL, Setenv set_vsi_log_error_level");
+//        LOGW("Not exist VSI_NN_LOG_LEVEL, Setenv set_vsi_log_error_level");^M

1 Like

Thank you Frank for you pointer.

For now I just do export VSI_NN_LOG_LEVEL=0 to disable the log.

@ptphucbk You can export it to close . But it’s temporary

1 Like

Hi Frank,

What do you mean by “temporary” ? Can you elaborate ?

Thank you very much

@ptphucbk If you close this terminal . export VSI_NN_LOG_LEVEL=0 will invalid .


Yeah I see.

For now the export serves me well but later will definitely use your patch in my codes.

Thank you.