MCPcopy Create free account
hub / github.com/Kitware/VTK / pj_vlog

Function pj_vlog

ThirdParty/libproj/vtklibproj/src/log.cpp:53–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51void pj_vlog( PJ_CONTEXT *ctx, int level, const char *fmt, va_list args );
52
53void pj_vlog( PJ_CONTEXT *ctx, int level, const char *fmt, va_list args )
54
55{
56 char *msg_buf;
57 int debug_level = ctx->debug_level;
58 int shutup_unless_errno_set = debug_level < 0;
59
60 /* For negative debug levels, we first start logging when errno is set */
61 if (ctx->last_errno==0 && shutup_unless_errno_set)
62 return;
63
64 if (debug_level < 0)
65 debug_level = -debug_level;
66
67 if( level > debug_level )
68 return;
69
70 constexpr size_t BUF_SIZE = 100000;
71 msg_buf = (char *) malloc(BUF_SIZE);
72 if( msg_buf == nullptr )
73 return;
74
75 vsnprintf( msg_buf, BUF_SIZE, fmt, args );
76 msg_buf[BUF_SIZE-1] = '\0';
77
78 ctx->logger( ctx->logger_app_data, level, msg_buf );
79
80 free( msg_buf );
81}
82
83
84/************************************************************************/

Callers 5

pj_logFunction · 0.85
proj_log_errorFunction · 0.85
proj_log_debugFunction · 0.85
proj_context_log_debugFunction · 0.85
proj_log_traceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected