Skip to content

Commit

Permalink
Merge pull request #2527 from rouault/fix_2526
Browse files Browse the repository at this point in the history
C API: avoid error messages to be emitted in PJ_LOG_NONE log level (fixes #2526)
  • Loading branch information
rouault authored Feb 12, 2021
2 parents 7f6c35f + d798506 commit 32d442d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/iso19111/c_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 32d442d

Please sign in to comment.