[PROJ] PROJ without proj.db

Søren Holm sgh at sgh.dk
Wed Mar 10 00:18:09 PST 2021


The function pointer is the third argument. I do indeed set the log function.

onsdag den 10. marts 2021 09.14.34 CET skrev Kristian Evers:
> Here’s the source proj_log_func():
> 
> /***************************************************************************
> **/ void proj_log_func (PJ_CONTEXT *ctx, void *app_data, PJ_LOG_FUNCTION
> logf) {
> /**************************************************************************
> **** Put a new logging function into P's context. The opaque object app_data
> is passed as first arg at each call to the logger
> ****************************************************************************
> **/ if (nullptr==ctx)
>         ctx = pj_get_default_ctx ();
>     ctx->logger_app_data = app_data;
>     if (nullptr!=logf)
>        ctx->logger = logf;
> }
> 
> So, by putting nullptr as the log function you end up with the default
> logging function. Try setting up an actual logger function and pass a
> pointer to that.
> 
> I can see how you might think that a null pointer would achieve something
> else, though. The docs should clarify that or perhaps the functionality
> should be changed to let logf==nullptr explicitly mean “shut up”. The
> latter is likely the best move based on the fact that if you are happy with
> the default logger you probably wouldn’t call proj_log_func() in the first
> place.
> 

-- 
Søren Holm




More information about the PROJ mailing list