public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batctl: added loglevel support for DBG_TT
@ 2011-05-10 17:17 Antonio Quartulli
  2011-05-30 12:09 ` Marek Lindner
  0 siblings, 1 reply; 2+ messages in thread
From: Antonio Quartulli @ 2011-05-10 17:17 UTC (permalink / raw)
  To: B.A.T.M.A.N

DBG_TT log level has been added to batman-adv to collect all the
messages related to Translation Table operations. This patch makes batctl
able to select such level.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
Patch "batman-adv: improved client announcement mechanism" introduces a new log
"channel" called DBG_TT. This patch makes batctl able to correctly handle it


sys.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/sys.c b/sys.c
index f8fa1f2..dbf5383 100644
--- a/sys.c
+++ b/sys.c
@@ -182,6 +182,7 @@ static void log_level_usage(void)
 int handle_loglevel(char *mesh_iface, int argc, char **argv)
 {
 	int optchar, res;
+	int log_level;
 	char *path_buff;
 
 	while ((optchar = getopt(argc, argv, "h")) != -1) {
@@ -208,14 +209,16 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv)
 	if (res != EXIT_SUCCESS)
 		goto out;
 
-	printf("[%c] %s (%d)\n", (line_ptr[0] == '0') ? 'x' : ' ',
+	log_level = strtol(line_ptr, (char **) NULL, 10);
+
+	printf("[%c] %s (%d)\n", (!log_level) ? 'x' : ' ',
 	       "all debug output disabled", 0);
-	printf("[%c] %s (%d)\n", (line_ptr[0] == '1') ? 'x' : ' ',
+	printf("[%c] %s (%d)\n", (log_level & 1) ? 'x' : ' ',
 	       "messages related to routing / flooding / broadcasting", 1);
-	printf("[%c] %s (%d)\n", (line_ptr[0] == '2') ? 'x' : ' ',
-	       "messages related to route or tt entry added / changed / deleted", 2);
-	printf("[%c] %s (%d)\n", (line_ptr[0] == '3') ? 'x' : ' ',
-	       "all debug messages", 3);
+	printf("[%c] %s (%d)\n", (log_level & 2) ? 'x' : ' ',
+	       "messages related to route added / changed / deleted", 2);
+	printf("[%c] %s (%d)\n", (log_level & 4) ? 'x' : ' ',
+	       "messages related to translation table operations", 4);
 
 out:
 	if (errno == ENOENT)
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batctl: added loglevel support for DBG_TT
  2011-05-10 17:17 [B.A.T.M.A.N.] [PATCH] batctl: added loglevel support for DBG_TT Antonio Quartulli
@ 2011-05-30 12:09 ` Marek Lindner
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Lindner @ 2011-05-30 12:09 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Tuesday 10 May 2011 19:17:59 Antonio Quartulli wrote:
> DBG_TT log level has been added to batman-adv to collect all the
> messages related to Translation Table operations. This patch makes batctl
> able to select such level.

Applied in revision 2499494.

Thanks,
Marek

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-30 12:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-10 17:17 [B.A.T.M.A.N.] [PATCH] batctl: added loglevel support for DBG_TT Antonio Quartulli
2011-05-30 12:09 ` Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox