From eebf2a232ccccfc158c1f3c71ec0231377c9e212 Mon Sep 17 00:00:00 2001 From: Lisanna Dettwyler Date: Mon, 9 Sep 2024 20:40:41 +0000 Subject: [PATCH] Add missing guards around debug messages Closes #195 Signed-off-by: Lisanna Dettwyler --- source/loader/ze_loader.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/loader/ze_loader.cpp b/source/loader/ze_loader.cpp index 5339b7f..3bbd47f 100644 --- a/source/loader/ze_loader.cpp +++ b/source/loader/ze_loader.cpp @@ -340,7 +340,8 @@ namespace loader loaderLibraryPath = readLevelZeroLoaderLibraryPath(); } #endif - debug_trace_message("Using Loader Library Path: ", loaderLibraryPath); + if (debugTraceEnabled) + debug_trace_message("Using Loader Library Path: ", loaderLibraryPath); // To allow for two different sets of drivers to be in use between sysman and core/tools, we use and store the drivers in two vectors. // alldrivers stores all the drivers for cleanup when the library exits. @@ -424,7 +425,8 @@ namespace loader tracingLayerEnabled = true; } std::string tracingLayerLibraryPath = create_library_path(MAKE_LAYER_NAME( "ze_tracing_layer" ), loaderLibraryPath.c_str()); - debug_trace_message("Tracing Layer Library Path: ", tracingLayerLibraryPath); + if (debugTraceEnabled) + debug_trace_message("Tracing Layer Library Path: ", tracingLayerLibraryPath); tracingLayer = LOAD_DRIVER_LIBRARY( tracingLayerLibraryPath.c_str() ); if(tracingLayer) {