Skip to contentSkip to conversation

chunkd: End-to-end verbosity

PATCH In review Pete Zaitcev 1 participant 1 message Apr 1, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 chunkd: End-to-end verbosity

---
 server/cldu.c   |    3 ++-
 server/server.c |    9 ++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

commit 764bd81a304fd3b961e7c3661a498ba0f6565a51

Author: Master <[email protected]>
Date:   Wed Mar 31 18:16:18 2010 -0600

End-2-end verbosity.

server/cldu.c +2 -1
index 51d01a3..b2d3388 100644
@@ -319,7 +319,8 @@ static int cldu_set_cldc(struct cld_session *cs, int newactive)
 		       hp->host, hp->port);
 
 	cs->nsess = ncld_sess_open(hp->host, hp->port, &error,
-				   cldu_sess_event, cs, "tabled", "tabled");
+				   cldu_sess_event, cs, "tabled", "tabled",
+				   &cldu_hail_log);
 	if (cs->nsess == NULL) {
 		if (error < 1000) {
 			applog(LOG_ERR, "ncld_sess_open(%s,%u) error: %s",
server/server.c +6 -3
index 69f3973..38fa5b6 100644
@@ -74,6 +74,8 @@ static struct argp_option options[] = {
 	  "Run in foreground, do not fork" },
 	{ "pid", 'P', "FILE", 0,
 	  "Write daemon process id to FILE" },
+	{ "verbose", 'v', NULL, 0,
+	  "Enable verbosity in libcldc" },
 	{ "strict-free", 1001, NULL, 0,
 	  "For memory-checker runs.  When shutting down server, free local "
 	  "heap, rather than simply exit(2)ing and letting OS clean up." },
@@ -186,6 +188,9 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state)
 	case 'P':
 		chunkd_srv.pid_file = strdup(arg);
 		break;
+	case 'v':
+		cldu_hail_log.verbose = true;
+		break;
 	case 1001:			/* --strict-free */
 		strict_free = true;
 		break;
@@ -1736,9 +1741,7 @@ int main (int argc, char *argv[])
 	if (use_syslog)
 		openlog(PROGRAM_NAME, LOG_PID, LOG_LOCAL3);
 	if (debugging)
-		applog(LOG_INFO, "Verbose debug output enabled");
-
-	cldu_hail_log.verbose = debugging;
+		applog(LOG_INFO, "Debug output enabled");
 
 	g_thread_init(NULL);
 	chunkd_srv.bigmutex = g_mutex_new();