Skip to content

Commit

Permalink
Debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramn committed Apr 22, 2024
1 parent 8a9186a commit 0411d77
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/grib_loader_from_handle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -123,15 +127,15 @@ 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;
}
#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)
Expand Down

0 comments on commit 0411d77

Please sign in to comment.