Browse Source

Use couple of -v / --verbose parameters to increase logging verbosity.

Georgi Chorbadzhiyski 9 years ago
parent
commit
15c33940e8
3 changed files with 5 additions and 3 deletions
  1. 1
    1
      README
  2. 2
    0
      cmd.c
  3. 2
    2
      videohubctrl.c

+ 1
- 1
README View File

@@ -81,7 +81,7 @@ Main options:
81 81
  -p --port <port_number>    | Set device port (default: 9990).
82 82
 
83 83
 Misc options:
84
- -v --verbose               | Enable verbose logging.
84
+ -v --verbose               | Increase logging verbosity.
85 85
  -q --quiet                 | Suppress warnings.
86 86
  -h --help                  | Show help screen.
87 87
  -V --version               | Show program version.

+ 2
- 0
cmd.c View File

@@ -163,6 +163,8 @@ bool parse_command(struct videohub_data *data, char *cmd) {
163 163
 	}
164 164
 
165 165
 	v("verbose: Got '%s' command.\n", v->txt);
166
+	if (verbose > 1)
167
+		v("----\n%s\n----\n", cmd);
166 168
 
167 169
 	bool cmd_response = false;
168 170
 	char *p, *cmd_data = xstrdup( cmd + strlen(v->txt) + 2 ); // +2 to compensate for :\n at the end of the command

+ 2
- 2
videohubctrl.c View File

@@ -54,7 +54,7 @@ static void show_help(struct videohub_data *data) {
54 54
 	printf(" -p --port <port_number>    | Set device port (default: 9990).\n");
55 55
 	printf("\n");
56 56
 	printf("Misc options:\n");
57
-	printf(" -v --verbose               | Enable verbose logging.\n");
57
+	printf(" -v --verbose               | Increase logging verbosity.\n");
58 58
 	printf(" -q --quiet                 | Suppress warnings.\n");
59 59
 	printf(" -h --help                  | Show help screen.\n");
60 60
 	printf(" -V --version               | Show program version.\n");
@@ -78,7 +78,7 @@ static void parse_options(struct videohub_data *data, int argc, char **argv) {
78 78
 				data->dev_port = optarg;
79 79
 				break;
80 80
 			case 'v': // --verbose
81
-				verbose = !verbose;
81
+				verbose++;
82 82
 				if (verbose)
83 83
 					quiet = 0; // Disable quiet
84 84
 				break;

Loading…
Cancel
Save