Reduce number of calls to grib_context_log for DEBUG

This commit is contained in:
Shahram Najm 2019-07-17 16:30:52 +01:00
parent 24589cbf88
commit 0fb7c82aef
3 changed files with 14 additions and 12 deletions

View File

@ -200,14 +200,16 @@ grib_accessor* grib_accessor_factory(grib_section* p, grib_action* creator,
}
}
if(p->owner)
grib_context_log(p->h->context, GRIB_LOG_DEBUG,
"Creating (%s)%s of %s at offset %d [len=%d]",
p->owner->name ,a->name ,creator->op, a->offset,len,p->block);
else
grib_context_log(p->h->context, GRIB_LOG_DEBUG,
"Creating root %s of %s at offset %d [len=%d]",
a->name ,creator->op, a->offset,len,p->block);
if (p->h->context->debug == 1) {
if(p->owner)
grib_context_log(p->h->context, GRIB_LOG_DEBUG,
"Creating (%s)%s of %s at offset %d [len=%d]",
p->owner->name ,a->name ,creator->op, a->offset,len,p->block);
else
grib_context_log(p->h->context, GRIB_LOG_DEBUG,
"Creating root %s of %s at offset %d [len=%d]",
a->name ,creator->op, a->offset,len,p->block);
}
return a;
}
@ -282,7 +284,7 @@ int grib_section_adjust_sizes(grib_section* s,int update,int depth)
/* grib_section_adjust_sizes(grib_get_sub_section(a),update,depth+1); */
err = grib_section_adjust_sizes(a->sub_section,update,depth+1);
if (err) return err;
grib_context_log(a->context,GRIB_LOG_DEBUG,"grib_section_adjust_sizes: %s %ld [len=%ld] (depth=%d)",a->name,(long)a->offset,(long)a->length,depth);
/*grib_context_log(a->context,GRIB_LOG_DEBUG,"grib_section_adjust_sizes: %s %ld [len=%ld] (depth=%d)",a->name,(long)a->offset,(long)a->length,depth);*/
l = a->length;
@ -331,7 +333,7 @@ int grib_section_adjust_sizes(grib_section* s,int update,int depth)
}
if(s->owner) {
grib_context_log(s->owner->context,GRIB_LOG_DEBUG,"grib_section_adjust_sizes: updating owner (%s->length old=%ld new=%ld)",s->owner->name,(long)s->owner->length,(long)length);
/*grib_context_log(s->owner->context,GRIB_LOG_DEBUG,"grib_section_adjust_sizes: updating owner (%s->length old=%ld new=%ld)",s->owner->name,(long)s->owner->length,(long)length);*/
s->owner->length = length;
}
s->length = length;

View File

@ -239,7 +239,7 @@ static grib_trie* load_bufr_elements_table(grib_accessor* a, int* err)
dictionary=(grib_trie*)grib_trie_get(c->lists,dictName);
if (dictionary) {
grib_context_log(c,GRIB_LOG_DEBUG,"using dictionary %s from cache",self->dictionary);
/*grib_context_log(c,GRIB_LOG_DEBUG,"using dictionary %s from cache",self->dictionary);*/
goto the_end;
} else {
grib_context_log(c,GRIB_LOG_DEBUG,"using dictionary %s from file %s",self->dictionary,filename);

View File

@ -166,7 +166,7 @@ static int unpack_string(grib_accessor*a , char* v, size_t *len)
*len = l;
return GRIB_BUFFER_TOO_SMALL;
}
grib_context_log(a->context,GRIB_LOG_DEBUG, "grib_accessor_long: Casting long %s to string ", a->name);
/*grib_context_log(a->context,GRIB_LOG_DEBUG, "grib_accessor_long: Casting long %s to string ", a->name);*/
*len = l;