Fix: saturate verbosity level to 3
authorDavid Goulet <dgoulet@efficios.com>
Fri, 23 May 2014 18:25:06 +0000 (14:25 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 23 May 2014 18:25:06 +0000 (14:25 -0400)
Fixes #748

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-relayd/main.c
src/bin/lttng-sessiond/main.c
src/bin/lttng/lttng.c

index 93b08fcaa4a32cddfb4deef66682e8a1b8ae6135..ac03cf846a7ec7992d7c21f9423d0af6813f22db 100644 (file)
@@ -251,7 +251,10 @@ int set_option(int opt, const char *arg, const char *optname)
                if (arg) {
                        lttng_opt_verbose = config_parse_value(arg);
                } else {
-                       lttng_opt_verbose += 1;
+                       /* Only 3 level of verbosity (-vvv). */
+                       if (lttng_opt_verbose < 3) {
+                               lttng_opt_verbose += 1;
+                       }
                }
                break;
        default:
index 1d218b170ec31112f750d5ffae02ff3d41080870..4d700d1e54130fae8ae19369e8bdc8e3b7ca7771 100644 (file)
@@ -4238,7 +4238,10 @@ static int set_option(int opt, const char *arg, const char *optname)
                if (arg) {
                        lttng_opt_verbose = config_parse_value(arg);
                } else {
-                       lttng_opt_verbose += 1;
+                       /* Only 3 level of verbosity (-vvv). */
+                       if (lttng_opt_verbose < 3) {
+                               lttng_opt_verbose += 1;
+                       }
                }
                break;
        case 'Z':
index 3227499f532fefdd3ed378e8d8d171ce7e40be4a..d4d40f07722ef8aad0097164af92456454418f90 100644 (file)
@@ -437,7 +437,10 @@ static int parse_args(int argc, char **argv)
                        ret = 0;
                        goto end;
                case 'v':
-                       lttng_opt_verbose += 1;
+                       /* There is only 3 possible level of verbosity. (-vvv) */
+                       if (lttng_opt_verbose < 3) {
+                               lttng_opt_verbose += 1;
+                       }
                        break;
                case 'q':
                        lttng_opt_quiet = 1;
This page took 0.033473 seconds and 4 git commands to generate.