The following commit has been merged in the master branch: commit 24994940e1e8770530c63751a99b4dd82390f1e4 Author: Antonio Quartulli ordex@autistici.org Date: Tue May 10 19:17:59 2011 +0200
batctl: added loglevel support for DBG_TT
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
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)