* [Patch 3/7] tabled: Reduce verbosity in CLD client
@ 2009-11-14 6:32 Pete Zaitcev
2009-11-14 8:37 ` Jeff Garzik
0 siblings, 1 reply; 3+ messages in thread
From: Pete Zaitcev @ 2009-11-14 6:32 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Project Hail List
I got into habit of watching logs and there was too much useless
messaging in them. Some messages were stubs and reminders, so I left
them in the code, but commented out.
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
---
server/cldu.c | 9 ++-------
server/storage.c | 2 ++
server/storparse.c | 5 +----
3 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/server/cldu.c b/server/cldu.c
index ea2266f..b48d86c 100644
--- a/server/cldu.c
+++ b/server/cldu.c
@@ -609,8 +609,8 @@ static int cldu_open_x_cb(struct cldc_call_opts *carg, enum cle_err_codes errc)
return 0;
}
- if (debugging)
- applog(LOG_DEBUG, "CLD directory \"%s\" opened", sp->xfname);
+ // if (debugging)
+ // applog(LOG_DEBUG, "CLD directory \"%s\" opened", sp->xfname);
/*
* Read the directory.
@@ -713,9 +713,6 @@ static void next_chunk(struct cld_session *sp)
}
sp->yfname = mem;
- if (debugging)
- applog(LOG_DEBUG, "opening chunk parameters %s", sp->yfname);
-
memset(&copts, 0, sizeof(copts));
copts.cb = cldu_open_y_cb;
copts.private = sp;
@@ -780,8 +777,6 @@ static int cldu_get_y_cb(struct cldc_call_opts *carg, enum cle_err_codes errc)
ptr = carg->u.get.buf;
len = carg->u.get.size;
- if (debugging)
- applog(LOG_DEBUG, "got %d bytes from %s", len, sp->yfname);
stor_parse(sp->yfname, ptr, len);
close_and_next:
diff --git a/server/storage.c b/server/storage.c
index e1368a6..f1822f7 100644
--- a/server/storage.c
+++ b/server/storage.c
@@ -387,6 +387,7 @@ static int stor_add_node_addr(struct storage_node *sn,
sn->addr_af = res->ai_family;
sn->alen = res->ai_addrlen;
+#if 0
if (debugging) {
char nhost[41];
char nport[6];
@@ -400,6 +401,7 @@ static int stor_add_node_addr(struct storage_node *sn,
applog(LOG_INFO, "Found Chunk host");
}
}
+#endif
/* Use just the first address for now. */
freeaddrinfo(res0);
diff --git a/server/storparse.c b/server/storparse.c
index d1c43a9..25841d2 100644
--- a/server/storparse.c
+++ b/server/storparse.c
@@ -145,7 +145,7 @@ static void cfg_elm_end_geo(struct config_context *cc)
}
if (!cc->loc.rack) {
- applog(LOG_WARNING, "%s: No rack in Geo element", cc->fname);
+ // applog(LOG_WARNING, "%s: No rack in Geo element", cc->fname);
goto end;
}
@@ -389,9 +389,6 @@ void stor_parse(char *fname, const char *text, size_t len)
applog(LOG_WARNING, "%s: No useable Socket clause", fname);
goto out_free_all;
}
- if (debugging)
- applog(LOG_DEBUG, "Adding NID %u host %s port %s",
- ctx.nid, ctx.stor_ok_host, ctx.stor_ok_port);
stor_add_node(ctx.nid, ctx.stor_ok_host, ctx.stor_ok_port, &ctx.loc);
out_free_all:
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Patch 3/7] tabled: Reduce verbosity in CLD client
2009-11-14 6:32 [Patch 3/7] tabled: Reduce verbosity in CLD client Pete Zaitcev
@ 2009-11-14 8:37 ` Jeff Garzik
2009-11-14 21:16 ` Pete Zaitcev
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2009-11-14 8:37 UTC (permalink / raw)
To: Pete Zaitcev; +Cc: Project Hail List
On 11/14/2009 01:32 AM, Pete Zaitcev wrote:
> I got into habit of watching logs and there was too much useless
> messaging in them. Some messages were stubs and reminders, so I left
> them in the code, but commented out.
>
> Signed-off-by: Pete Zaitcev<zaitcev@redhat.com>
I applied this, just to keep things moving, but would really like to see
one of two things for each commented-out statement:
1) remove it
2) switch to cld's "-D debuglevel" option format, and bury the logging
statements under a debug level that produces a higher verbosity.
cld has three levels:
0, no debug stmts
1, a reasonable amount of debug stmts
2, everything including per-request verbose output
but tabled need not be tied strictly to three debug levels.
One of the minor design goals of each Hail sub-project is to avoid
#ifdefs and commented-out sections, and always compile 100% of the
source code. Commented-out statements just clutter the code, and _very
quickly_ become obsolete because you do not compile them on a regular basis.
If you want to disable something at compile time, use an enum. That
ensures the disabled code branch makes it to the C compiler for full
type checking, even if the optimizer later strips it out.
Otherwise, just use a simple runtime test to enable/disable features (or
simply delete the code).
Jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Patch 3/7] tabled: Reduce verbosity in CLD client
2009-11-14 8:37 ` Jeff Garzik
@ 2009-11-14 21:16 ` Pete Zaitcev
0 siblings, 0 replies; 3+ messages in thread
From: Pete Zaitcev @ 2009-11-14 21:16 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Project Hail List
On Sat, 14 Nov 2009 03:37:50 -0500, Jeff Garzik <jeff@garzik.org> wrote:
> On 11/14/2009 01:32 AM, Pete Zaitcev wrote:
> 1) remove it
>
> 2) switch to cld's "-D debuglevel" option format, and bury the logging
> statements under a debug level that produces a higher verbosity.
Anything but that. Debugging levels are the worst idea ever.
I'll drop them.
-- Pete
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-11-14 21:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-14 6:32 [Patch 3/7] tabled: Reduce verbosity in CLD client Pete Zaitcev
2009-11-14 8:37 ` Jeff Garzik
2009-11-14 21:16 ` Pete Zaitcev
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.