aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-02-12 12:23:40 +0100
committerGitHub <noreply@github.com>2021-02-12 12:23:40 +0100
commit32d442ddc69cbc159c75781f33c575ea5b11fc43 (patch)
tree3dd420d624bb683fcaa2bd10fcc894a1fe46187f
parent7f6c35f0cc2d80ba9c43d4342ca3b1968b9adea5 (diff)
parentd79850629a60c0512a365a183fba7d8985f7e14c (diff)
downloadPROJ-32d442ddc69cbc159c75781f33c575ea5b11fc43.tar.gz
PROJ-32d442ddc69cbc159c75781f33c575ea5b11fc43.zip
Merge pull request #2527 from rouault/fix_2526
C API: avoid error messages to be emitted in PJ_LOG_NONE log level (fixes #2526)
-rw-r--r--src/iso19111/c_api.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/iso19111/c_api.cpp b/src/iso19111/c_api.cpp
index ae13b40d..c3e428d2 100644
--- a/src/iso19111/c_api.cpp
+++ b/src/iso19111/c_api.cpp
@@ -75,10 +75,12 @@ using namespace NS_PROJ;
static void PROJ_NO_INLINE proj_log_error(PJ_CONTEXT *ctx, const char *function,
const char *text) {
- std::string msg(function);
- msg += ": ";
- msg += text;
- ctx->logger(ctx->logger_app_data, PJ_LOG_ERROR, msg.c_str());
+ if (ctx->debug_level != PJ_LOG_NONE) {
+ std::string msg(function);
+ msg += ": ";
+ msg += text;
+ ctx->logger(ctx->logger_app_data, PJ_LOG_ERROR, msg.c_str());
+ }
auto previous_errno = proj_context_errno(ctx);
if (previous_errno == 0) {
// only set errno if it wasn't set deeper down the call stack