mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 13:58:34 +00:00
crtools: handle -vv..vv propertly
-vv...v must increase logging level on a number of the 'v' symbols. Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
9a2219af0c
commit
5aa409afcf
12
crtools.c
12
crtools.c
@@ -171,9 +171,13 @@ int main(int argc, char *argv[])
|
||||
return -1;
|
||||
break;
|
||||
case 'v':
|
||||
if (optarg)
|
||||
log_level = atoi(optarg);
|
||||
else
|
||||
if (optarg) {
|
||||
if (optarg[0] == 'v')
|
||||
/* handle -vvvvv */
|
||||
log_level += strlen(optarg) + 1;
|
||||
else
|
||||
log_level = atoi(optarg);
|
||||
} else
|
||||
log_level++;
|
||||
break;
|
||||
case 41:
|
||||
@@ -392,7 +396,7 @@ usage:
|
||||
"* Logging:\n"
|
||||
" -o|--log-file FILE log file name (path is relative to --images-dir)\n"
|
||||
" --log-pid enable per-process logging to separate FILE.pid files\n"
|
||||
" -v [NUM] set logging level:\n"
|
||||
" -v[NUM] set logging level:\n"
|
||||
" -v0 - messages regardless of log level\n"
|
||||
" -v1, -v - errors, when we are in trouble\n"
|
||||
" -v2, -vv - warnings (default)\n"
|
||||
|
Reference in New Issue
Block a user