Debugging

This commit is contained in:
shahramn 2024-04-22 16:56:18 +01:00
parent bb58b93116
commit 50bc16dadb
1 changed files with 7 additions and 3 deletions

View File

@ -10,6 +10,10 @@
#include "grib_api_internal.h"
#if defined DEBUG && ! defined GRIB_PTHREADS
#define MY_DEBUG
#endif
static int copy_values(grib_handle* h, grib_accessor* ga)
{
int i, j, k;
@ -62,7 +66,7 @@ int grib_init_accessor_from_handle(grib_loader* loader, grib_accessor* ga, grib_
unsigned char* uval = NULL;
long* lval = NULL;
double* dval = NULL;
#ifdef DEBUG
#ifdef MY_DEBUG
static int first = 1;
static const char* missing = 0;
#endif
@ -123,7 +127,7 @@ int grib_init_accessor_from_handle(grib_loader* loader, grib_accessor* ga, grib_
if (ret != GRIB_SUCCESS) {
name = ga->name;
#ifdef DEBUG
#ifdef MY_DEBUG
if (first) {
missing = codes_getenv("ECCODES_PRINT_MISSING");
first = 0;
@ -131,7 +135,7 @@ int grib_init_accessor_from_handle(grib_loader* loader, grib_accessor* ga, grib_
#endif
grib_context_log(h->context, GRIB_LOG_DEBUG, "Copying [%s] failed: %s",
name, grib_get_error_message(ret));
#ifdef DEBUG
#ifdef MY_DEBUG
if (missing) {
fprintf(stdout, "REPARSE: no value for %s", name);
if (default_value)