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

+ 2
- 0
cmd.c View File

163
 	}
163
 	}
164
 
164
 
165
 	v("verbose: Got '%s' command.\n", v->txt);
165
 	v("verbose: Got '%s' command.\n", v->txt);
166
+	if (verbose > 1)
167
+		v("----\n%s\n----\n", cmd);
166
 
168
 
167
 	bool cmd_response = false;
169
 	bool cmd_response = false;
168
 	char *p, *cmd_data = xstrdup( cmd + strlen(v->txt) + 2 ); // +2 to compensate for :\n at the end of the command
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
 	printf(" -p --port <port_number>    | Set device port (default: 9990).\n");
54
 	printf(" -p --port <port_number>    | Set device port (default: 9990).\n");
55
 	printf("\n");
55
 	printf("\n");
56
 	printf("Misc options:\n");
56
 	printf("Misc options:\n");
57
-	printf(" -v --verbose               | Enable verbose logging.\n");
57
+	printf(" -v --verbose               | Increase logging verbosity.\n");
58
 	printf(" -q --quiet                 | Suppress warnings.\n");
58
 	printf(" -q --quiet                 | Suppress warnings.\n");
59
 	printf(" -h --help                  | Show help screen.\n");
59
 	printf(" -h --help                  | Show help screen.\n");
60
 	printf(" -V --version               | Show program version.\n");
60
 	printf(" -V --version               | Show program version.\n");
78
 				data->dev_port = optarg;
78
 				data->dev_port = optarg;
79
 				break;
79
 				break;
80
 			case 'v': // --verbose
80
 			case 'v': // --verbose
81
-				verbose = !verbose;
81
+				verbose++;
82
 				if (verbose)
82
 				if (verbose)
83
 					quiet = 0; // Disable quiet
83
 					quiet = 0; // Disable quiet
84
 				break;
84
 				break;

Loading…
Cancel
Save