changeset 2928:85999ed092c5

New CMake option "ENABLE_DCMTK_LOG" to disable logging internal to DCMTK
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 09 Nov 2018 14:48:32 +0100
parents 9f48722e8508
children e0c620f964e5
files NEWS Resources/CMake/DcmtkConfiguration.cmake Resources/CMake/OrthancFrameworkParameters.cmake
diffstat 3 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Fri Nov 09 14:07:06 2018 +0100
+++ b/NEWS	Fri Nov 09 14:48:32 2018 +0100
@@ -31,6 +31,7 @@
 * Fix: Allow creation of MONOCHROME1 grayscale images in tools/create-dicom
 * Remove invalid characters from badly-encoded UTF-8 strings (impacts PostgreSQL)
 * Orthanc starts even if jobs from a previous execution cannot be unserialized
+* New CMake option "ENABLE_DCMTK_LOG" to disable logging internal to DCMTK
 
 
 Version 1.4.2 (2018-09-20)
--- a/Resources/CMake/DcmtkConfiguration.cmake	Fri Nov 09 14:07:06 2018 +0100
+++ b/Resources/CMake/DcmtkConfiguration.cmake	Fri Nov 09 14:48:32 2018 +0100
@@ -324,6 +324,18 @@
     -DDCMTK_VERSION_NUMBER=${DCMTK_VERSION_NUMBER}
     )
 
+  if (NOT ENABLE_DCMTK_LOG)
+    # Disable logging internal to DCMTK
+    # https://groups.google.com/d/msg/orthanc-users/v2SzzAmY948/VxT1QVGiBAAJ
+    add_definitions(
+      -DDCMTK_LOG4CPLUS_DISABLE_FATAL=1
+      -DDCMTK_LOG4CPLUS_DISABLE_ERROR=1
+      -DDCMTK_LOG4CPLUS_DISABLE_WARN=1
+      -DDCMTK_LOG4CPLUS_DISABLE_INFO=1
+      -DDCMTK_LOG4CPLUS_DISABLE_DEBUG=1
+      )
+  endif()
+
   include_directories(
     #${DCMTK_SOURCES_DIR}
     ${DCMTK_SOURCES_DIR}/config/include
--- a/Resources/CMake/OrthancFrameworkParameters.cmake	Fri Nov 09 14:07:06 2018 +0100
+++ b/Resources/CMake/OrthancFrameworkParameters.cmake	Fri Nov 09 14:48:32 2018 +0100
@@ -59,6 +59,7 @@
 set(USE_DCMTK_360 OFF CACHE BOOL "Use older DCMTK version 3.6.0 in static builds (instead of default 3.6.2)")
 set(USE_DCMTK_362_PRIVATE_DIC ON CACHE BOOL "Use the dictionary of private tags from DCMTK 3.6.2 if using DCMTK 3.6.0")
 set(USE_SYSTEM_DCMTK ON CACHE BOOL "Use the system version of DCMTK")
+set(ENABLE_DCMTK_LOG ON CACHE BOOL "Enable logging internal to DCMTK")
 set(ENABLE_DCMTK_JPEG ON CACHE BOOL "Enable JPEG-LS (Lossless) decompression")
 set(ENABLE_DCMTK_JPEG_LOSSLESS ON CACHE BOOL "Enable JPEG-LS (Lossless) decompression")