From 1761095abc4aedf2502884a656307bc2f8305e36 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 5 Apr 2018 13:55:04 +0200 Subject: Logging: use -1 log level to log all levels --- source/creator/creator_args.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c index d4af3cd6b09..1baae1864bf 100644 --- a/source/creator/creator_args.c +++ b/source/creator/creator_args.c @@ -715,16 +715,19 @@ static int arg_handle_background_mode_set(int UNUSED(argc), const char **UNUSED( static const char arg_handle_log_level_set_doc[] = "\n" "\n" -"\tSet the logging verbosity level (higher for more details) defaults to 1." +"\tSet the logging verbosity level (higher for more details) defaults to 1, use -1 to log all levels." ; static int arg_handle_log_level_set(int argc, const char **argv, void *UNUSED(data)) { const char *arg_id = "--log-level"; if (argc > 1) { const char *err_msg = NULL; - if (!parse_int_clamp(argv[1], NULL, 0, INT_MAX, &G.log.level, &err_msg)) { + if (!parse_int_clamp(argv[1], NULL, -1, INT_MAX, &G.log.level, &err_msg)) { printf("\nError: %s '%s %s'.\n", err_msg, arg_id, argv[1]); } + if (G.log.level == -1) { + G.log.level = INT_MAX; + } return 1; } else { -- cgit v1.2.3