diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-03-31 16:27:06 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-03-31 16:29:46 +0300 |
commit | db8e7f9780f9148704a986290b9493e27b350fe4 (patch) | |
tree | 0c836627d4d6bb6a251fe9eabc631cd590a91f14 /source/creator/creator_args.c | |
parent | 5cb440492e2fb588765449e7a125720a2961a3f6 (diff) |
Logging: add argument --log-show-basename
Optionally strips leading path from filenames when logging.
Diffstat (limited to 'source/creator/creator_args.c')
-rw-r--r-- | source/creator/creator_args.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c index b7150bca47f..d4af3cd6b09 100644 --- a/source/creator/creator_args.c +++ b/source/creator/creator_args.c @@ -535,6 +535,7 @@ static int arg_handle_print_help(int UNUSED(argc), const char **UNUSED(argv), vo printf("Logging Options:\n"); BLI_argsPrintArgDoc(ba, "--log"); BLI_argsPrintArgDoc(ba, "--log-level"); + BLI_argsPrintArgDoc(ba, "--log-show-basename"); BLI_argsPrintArgDoc(ba, "--log-file"); printf("\n"); @@ -732,6 +733,15 @@ static int arg_handle_log_level_set(int argc, const char **argv, void *UNUSED(da } } +static const char arg_handle_log_show_basename_set_doc[] = +"\n\tOnly show file name in output (not the leading path)." +; +static int arg_handle_log_show_basename_set(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data)) +{ + CLG_output_use_basename_set(true); + return 0; +} + static const char arg_handle_log_file_set_doc[] = "<filename>\n" "\n" @@ -1931,6 +1941,7 @@ void main_args_setup(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle) BLI_argsAdd(ba, 1, NULL, "--log", CB(arg_handle_log_set), ba); BLI_argsAdd(ba, 1, NULL, "--log-level", CB(arg_handle_log_level_set), ba); + BLI_argsAdd(ba, 1, NULL, "--log-show-basename", CB(arg_handle_log_show_basename_set), ba); BLI_argsAdd(ba, 1, NULL, "--log-file", CB(arg_handle_log_file_set), ba); BLI_argsAdd(ba, 1, "-d", "--debug", CB(arg_handle_debug_mode_set), ba); |