# HG changeset patch # User Sebastien Jodogne # Date 1438690457 -7200 # Node ID e460341872dc923e6b8d5d0973599cdf420c609b # Parent 5969277224039448f04444c02b84d3fd63554f79 cont diff -r 596927722403 -r e460341872dc Core/ImageFormats/ImageAccessor.cpp --- a/Core/ImageFormats/ImageAccessor.cpp Tue Aug 04 14:04:48 2015 +0200 +++ b/Core/ImageFormats/ImageAccessor.cpp Tue Aug 04 14:14:17 2015 +0200 @@ -106,7 +106,10 @@ { if (readOnly_) { +#if ORTHANC_ENABLE_LOGGING == 1 LOG(ERROR) << "Trying to write on a read-only image"; +#endif + throw OrthancException(ErrorCode_ReadOnly); } @@ -131,7 +134,10 @@ { if (readOnly_) { +#if ORTHANC_ENABLE_LOGGING == 1 LOG(ERROR) << "Trying to write on a read-only image"; +#endif + throw OrthancException(ErrorCode_ReadOnly); } diff -r 596927722403 -r e460341872dc Core/Logging.h --- a/Core/Logging.h Tue Aug 04 14:04:48 2015 +0200 +++ b/Core/Logging.h Tue Aug 04 14:14:17 2015 +0200 @@ -90,4 +90,4 @@ } } -#endif +#endif // ORTHANC_ENABLE_LOGGING diff -r 596927722403 -r e460341872dc Core/Toolbox.cpp --- a/Core/Toolbox.cpp Tue Aug 04 14:04:48 2015 +0200 +++ b/Core/Toolbox.cpp Tue Aug 04 14:14:17 2015 +0200 @@ -1132,7 +1132,10 @@ if (pid == -1) { // Error in fork() +#if ORTHANC_ENABLE_LOGGING == 1 LOG(ERROR) << "Cannot fork a child process"; +#endif + throw OrthancException(ErrorCode_SystemCommand); } else if (pid == 0) @@ -1152,7 +1155,10 @@ if (status != 0) { +#if ORTHANC_ENABLE_LOGGING == 1 LOG(ERROR) << "System command failed with status code " << status; +#endif + throw OrthancException(ErrorCode_SystemCommand); } }