Skip to content

Commit 9f799df

Browse files
committed
PROJ6: redirect PROJ error/debug messages to msDebug()
1 parent 5f6ebab commit 9f799df

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Diff for: mapproject.c

+19
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,24 @@ static PJ* getBaseGeographicCRS(projectionObj* in)
231231
return NULL;
232232
}
233233

234+
/************************************************************************/
235+
/* msProjErrorLogger() */
236+
/************************************************************************/
237+
238+
static void msProjErrorLogger(void * user_data,
239+
int level, const char * message)
240+
{
241+
(void)user_data;
242+
if( level == PJ_LOG_ERROR )
243+
{
244+
msDebug( "PROJ: Error: %s\n", message );
245+
}
246+
else if( level == PJ_LOG_DEBUG )
247+
{
248+
msDebug( "PROJ: Debug: %s\n", message );
249+
}
250+
}
251+
234252
/************************************************************************/
235253
/* msProjectionContextCreate() */
236254
/************************************************************************/
@@ -252,6 +270,7 @@ projectionContext* msProjectionContextCreate(void)
252270
const char* const paths[1] = { ms_proj_lib };
253271
proj_context_set_search_paths(ctx->proj_ctx, 1, paths);
254272
}
273+
proj_log_func (ctx->proj_ctx, NULL, msProjErrorLogger);
255274
return ctx;
256275
}
257276

0 commit comments

Comments
 (0)