mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-17 05:40:13 +01:00
Add --debug-json switch and log level.
The JSON structures should not be printed by default to debug log. This flag introduces new debug level that prints JSON structures and keeps default debug output separate.
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
|
||||
int opt_verbose = 0;
|
||||
int opt_debug = 0;
|
||||
int opt_debug_json = 0;
|
||||
int opt_batch_mode = 0;
|
||||
int opt_progress_frequency = 0;
|
||||
|
||||
@@ -112,6 +113,7 @@ void tool_log(int level, const char *msg, void *usrptr __attribute__((unused)))
|
||||
case CRYPT_LOG_ERROR:
|
||||
fprintf(stderr, "%s", msg);
|
||||
break;
|
||||
case CRYPT_LOG_DEBUG_JSON:
|
||||
case CRYPT_LOG_DEBUG:
|
||||
if (opt_debug)
|
||||
fprintf(stdout, "# %s\n", msg);
|
||||
|
||||
Reference in New Issue
Block a user