From c588409ab78b7fc996ba60df4b9776fe774c7f1a Mon Sep 17 00:00:00 2001 From: sleske Date: Thu, 5 Jul 2012 20:39:42 +0000 Subject: [PATCH] Fix:core:Reduce debug output, use dbg() instead of printf. git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@5182 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/navit/attr.c | 6 +++--- navit/navit/callback.c | 8 ++++---- navit/navit/coord.c | 2 +- navit/navit/map/textfile/textfile.c | 15 +++++++-------- navit/navit/navit.c | 6 +++--- navit/navit/track.c | 4 ++-- navit/navit/transform.c | 2 +- navit/navit/xmlconfig.c | 2 +- 8 files changed, 22 insertions(+), 23 deletions(-) diff --git a/navit/navit/attr.c b/navit/navit/attr.c index db59d28..785cdfb 100644 --- a/navit/navit/attr.c +++ b/navit/navit/attr.c @@ -109,7 +109,7 @@ attr_new_from_text(const char *name, const char *value) int min,max,count; ret=g_new0(struct attr, 1); - dbg(1,"enter name='%s' value='%s'\n", name, value); + dbg(3,"enter name='%s' value='%s'\n", name, value); attr=attr_from_name(name); ret->type=attr; switch (attr) { @@ -355,9 +355,9 @@ attr_to_text(struct attr *attr, struct map *map, int pretty) struct attr * attr_search(struct attr **attrs, struct attr *last, enum attr_type attr) { - dbg(1, "enter attrs=%p\n", attrs); + dbg(2, "enter attrs=%p\n", attrs); while (*attrs) { - dbg(1,"*attrs=%p\n", *attrs); + dbg(3,"*attrs=%p\n", *attrs); if ((*attrs)->type == attr) { return *attrs; } diff --git a/navit/navit/callback.c b/navit/navit/callback.c index aa38f59..2bdcd9a 100644 --- a/navit/navit/callback.c +++ b/navit/navit/callback.c @@ -143,13 +143,13 @@ callback_call(struct callback *cb, int pcount, void **p) if (! cb) return; if (cb->pcount + pcount <= 8) { - dbg(1,"cb->pcount=%d\n", cb->pcount); + dbg(3,"cb->pcount=%d\n", cb->pcount); if (cb->pcount && cb->p) - dbg(1,"cb->p[0]=%p\n", cb->p[0]); - dbg(1,"pcount=%d\n", pcount); + dbg(3,"cb->p[0]=%p\n", cb->p[0]); + dbg(3,"pcount=%d\n", pcount); if (pcount) { dbg_assert(p!=NULL); - dbg(1,"p[0]=%p\n", p[0]); + dbg(3,"p[0]=%p\n", p[0]); } for (i = 0 ; i < cb->pcount ; i++) pf[i]=cb->p[i]; diff --git a/navit/navit/coord.c b/navit/navit/coord.c index 58fa4b1..45729ec 100644 --- a/navit/navit/coord.c +++ b/navit/navit/coord.c @@ -104,7 +104,7 @@ coord_rect_overlap(struct coord_rect *r1, struct coord_rect *r2) dbg_assert(r1->lu.y >= r1->rl.y); dbg_assert(r2->lu.x <= r2->rl.x); dbg_assert(r2->lu.y >= r2->rl.y); - dbg(1,"0x%x,0x%x - 0x%x,0x%x vs 0x%x,0x%x - 0x%x,0x%x\n", r1->lu.x, r1->lu.y, r1->rl.x, r1->rl.y, r2->lu.x, r2->lu.y, r2->rl.x, r2->rl.y); + dbg(3,"0x%x,0x%x - 0x%x,0x%x vs 0x%x,0x%x - 0x%x,0x%x\n", r1->lu.x, r1->lu.y, r1->rl.x, r1->rl.y, r2->lu.x, r2->lu.y, r2->rl.x, r2->rl.y); if (r1->lu.x > r2->rl.x) return 0; if (r1->rl.x < r2->lu.x) diff --git a/navit/navit/map/textfile/textfile.c b/navit/navit/map/textfile/textfile.c index 821c442..89dccd9 100644 --- a/navit/navit/map/textfile/textfile.c +++ b/navit/navit/map/textfile/textfile.c @@ -58,14 +58,13 @@ get_line(struct map_rect_priv *mr) remove_comment_line(mr->line); mr->lastlen=strlen(mr->line)+1; if (strlen(mr->line) >= TEXTFILE_LINE_SIZE-1) - printf("line too long\n"); + dbg(0, "line too long: %s\n", mr->line); } } static void map_destroy_textfile(struct map_priv *m) { - dbg(1,"map_destroy_textfile\n"); g_free(m->filename); if(m->charset) { g_free(m->charset); @@ -95,7 +94,7 @@ textfile_coord_get(void *priv_data, struct coord *c, int count) { struct map_rect_priv *mr=priv_data; int ret=0; - dbg(1,"textfile_coord_get %d\n",count); + dbg(1,"enter, count: %d\n",count); while (count--) { if (mr->f && !feof(mr->f) && (!mr->item.id_hi || !mr->eoc) && parse_line(mr, mr->item.id_hi)) { *c=mr->c; @@ -135,7 +134,7 @@ textfile_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr) { struct map_rect_priv *mr=priv_data; char *str=NULL; - dbg(1,"textfile_attr_get mr=%p attrs='%s' ", mr, mr->attrs); + dbg(1,"mr=%p attrs='%s' ", mr, mr->attrs); if (attr_type != mr->attr_last) { dbg(1,"reset attr_pos\n"); mr->attr_pos=0; @@ -175,7 +174,7 @@ map_rect_new_textfile(struct map_priv *map, struct map_selection *sel) { struct map_rect_priv *mr; - dbg(1,"map_rect_new_textfile\n"); + dbg(1,"enter\n"); mr=g_new0(struct map_rect_priv, 1); mr->m=map; mr->sel=sel; @@ -209,13 +208,13 @@ map_rect_new_textfile(struct map_priv *map, struct map_selection *sel) mr->pos=0; mr->lastlen=0; #else - dbg(0,"map_rect_new_textfile is unable to work with pipes %s\n",map->filename); + dbg(0,"unable to work with pipes %s\n",map->filename); #endif } else { mr->f=fopen(map->filename, "r"); } if(!mr->f) { - printf("map_rect_new_textfile unable to open textfile %s. Error: %s\n",map->filename, strerror(errno)); + dbg(0, "error opening textfile %s: %s\n",map->filename, strerror(errno)); } get_line(mr); return mr; @@ -306,7 +305,7 @@ map_rect_get_item_textfile(struct map_rect_priv *mr) dbg(1,"type='%s'\n", type); mr->item.type=item_from_name(type); if (mr->item.type == type_none) - printf("Warning: type '%s' unknown\n", type); + dbg(0, "Warning: type '%s' unknown\n", type); } else { get_line(mr); continue; diff --git a/navit/navit/navit.c b/navit/navit/navit.c index 35f14e7..1f81847 100644 --- a/navit/navit/navit.c +++ b/navit/navit/navit.c @@ -1434,7 +1434,7 @@ navit_new(struct attr *parent, struct attr **attrs) this_->messages = messagelist_new(attrs); - dbg(0,"return %p\n",this_); + dbg(1,"return %p\n",this_); return this_; } @@ -3346,7 +3346,7 @@ struct navit * navit_ref(struct navit *this_) { this_->refcount++; - dbg(0,"refcount %d\n",this_->refcount); + dbg(1,"refcount %d\n",this_->refcount); return this_; } @@ -3354,7 +3354,7 @@ void navit_unref(struct navit *this_) { this_->refcount--; - dbg(0,"refcount %d\n",this_->refcount); + dbg(1,"refcount %d\n",this_->refcount); if (this_->refcount <= 0) navit_destroy(this_); } diff --git a/navit/navit/track.c b/navit/navit/track.c index c75b77e..7ee12a8 100644 --- a/navit/navit/track.c +++ b/navit/navit/track.c @@ -867,7 +867,7 @@ struct tracking * tracking_ref(struct tracking *this_) { this_->refcount++; - dbg(0,"refcount %d\n",this_->refcount); + dbg(1,"refcount %d\n",this_->refcount); return this_; } @@ -875,7 +875,7 @@ void tracking_unref(struct tracking *this_) { this_->refcount--; - dbg(0,"refcount %d\n",this_->refcount); + dbg(1,"refcount %d\n",this_->refcount); if (this_->refcount <= 0) tracking_destroy(this_); } diff --git a/navit/navit/transform.c b/navit/navit/transform.c index d57c50b..8ed86d2 100644 --- a/navit/navit/transform.c +++ b/navit/navit/transform.c @@ -427,7 +427,7 @@ transform(struct transformation *t, enum projection pro, struct coord *c, struct int zlimit=t->znear; int visible, visibleo=-1; int i,j = 0,k=0; - dbg(1,"count=%d\n", count); + dbg(3,"count=%d\n", count); for (i=0; i < count; i++) { if (pro == t->pro) { xc=c[i].x; diff --git a/navit/navit/xmlconfig.c b/navit/navit/xmlconfig.c index e355644..0276485 100644 --- a/navit/navit/xmlconfig.c +++ b/navit/navit/xmlconfig.c @@ -147,7 +147,7 @@ static struct attr ** convert_to_attrs(struct xmlstate *state, struct attr_fixme attribute_value++; } ret[count]=NULL; - dbg(1,"ret=%p\n", ret); + dbg(3,"ret=%p\n", ret); return ret; } -- 2.7.4