From 7043d3667a14eae46fc0b16aa1cf745eab9f38b3 Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Mon, 3 Dec 2018 13:58:32 +0000 Subject: COMPMID-1824 Disable logging completely when building with logging=0 Change-Id: Ie0d5387c0546045e14e62c84c03894a9b0339585 Reviewed-on: https://review.mlplatform.org/335 Reviewed-by: Pablo Marquez Tested-by: Arm Jenkins --- arm_compute/core/Log.h | 4 ++++ arm_compute/core/Utils.h | 2 ++ arm_compute/graph/Logger.h | 4 ++++ 3 files changed, 10 insertions(+) (limited to 'arm_compute') diff --git a/arm_compute/core/Log.h b/arm_compute/core/Log.h index 70e7c51110..2d8d396459 100644 --- a/arm_compute/core/Log.h +++ b/arm_compute/core/Log.h @@ -26,6 +26,7 @@ #include "arm_compute/core/utils/logging/Macros.h" +#ifdef ARM_COMPUTE_LOGGING_ENABLED /** Create a default core logger * * @note It will eventually create all default loggers in don't exist @@ -38,6 +39,9 @@ arm_compute::logging::LoggerRegistry::get().create_reserved_loggers(); \ } \ } while(false) +#else /* ARM_COMPUTE_LOGGING_ENABLED */ +#define ARM_COMPUTE_CREATE_DEFAULT_CORE_LOGGER() +#endif /* ARM_COMPUTE_LOGGING_ENABLED */ /** Log a message to the core system logger * diff --git a/arm_compute/core/Utils.h b/arm_compute/core/Utils.h index f1395a40d9..7c5d87f475 100644 --- a/arm_compute/core/Utils.h +++ b/arm_compute/core/Utils.h @@ -1024,6 +1024,7 @@ inline std::string float_to_string_with_full_precision(float val) return ss.str(); } +#ifdef ARM_COMPUTE_DEBUG_ENABLED /** Print consecutive elements to an output stream. * * @param[out] s Output stream to print the elements to. @@ -1112,5 +1113,6 @@ void print_consecutive_elements(std::ostream &s, DataType dt, const uint8_t *ptr * @return The maximum width of the elements. */ int max_consecutive_elements_display_width(std::ostream &s, DataType dt, const uint8_t *ptr, unsigned int n); +#endif /* ARM_COMPUTE_DEBUG_ENABLED */ } #endif /*__ARM_COMPUTE_UTILS_H__ */ diff --git a/arm_compute/graph/Logger.h b/arm_compute/graph/Logger.h index 8b87f47b3d..8946d82a51 100644 --- a/arm_compute/graph/Logger.h +++ b/arm_compute/graph/Logger.h @@ -26,6 +26,7 @@ #include "arm_compute/core/utils/logging/Macros.h" +#ifdef ARM_COMPUTE_LOGGING_ENABLED /** Create a default core logger * * @note It will eventually create all default loggers in don't exist @@ -38,6 +39,9 @@ arm_compute::logging::LoggerRegistry::get().create_reserved_loggers(); \ } \ } while(false) +#else /* ARM_COMPUTE_LOGGING_ENABLED */ +#define ARM_COMPUTE_CREATE_DEFAULT_GRAPH_LOGGER() +#endif /* ARM_COMPUTE_LOGGING_ENABLED */ #define ARM_COMPUTE_LOG_GRAPH(log_level, x) \ ARM_COMPUTE_CREATE_DEFAULT_GRAPH_LOGGER(); \ -- cgit v1.2.1