Fix logging "bke.appdir" messages

Logging was initialized after BKE_appdir paths were initialized,
making it impossible to see paths which are checked on startup.
This commit is contained in:
Campbell Barton 2021-04-21 13:44:23 +10:00
parent 3735986e87
commit 5da3177190
1 changed files with 9 additions and 7 deletions

View File

@ -2041,6 +2041,15 @@ void main_args_setup(bContext *C, bArgs *ba)
BLI_args_add(ba, "-t", "--threads", CB(arg_handle_threads_set), NULL);
/* Include in the environment pass so it's possible display errors initializing subsystems,
* especially `bpy.appdir` since it's useful to show errors finding paths on startup. */
BLI_args_add(ba, NULL, "--log", CB(arg_handle_log_set), ba);
BLI_args_add(ba, NULL, "--log-level", CB(arg_handle_log_level_set), ba);
BLI_args_add(ba, NULL, "--log-show-basename", CB(arg_handle_log_show_basename_set), ba);
BLI_args_add(ba, NULL, "--log-show-backtrace", CB(arg_handle_log_show_backtrace_set), ba);
BLI_args_add(ba, NULL, "--log-show-timestamp", CB(arg_handle_log_show_timestamp_set), ba);
BLI_args_add(ba, NULL, "--log-file", CB(arg_handle_log_file_set), ba);
/* Pass: Background Mode & Settings
*
* Also and commands that exit after usage. */
@ -2062,13 +2071,6 @@ void main_args_setup(bContext *C, bArgs *ba)
BLI_args_add(ba, "-a", NULL, CB(arg_handle_playback_mode), NULL);
BLI_args_add(ba, NULL, "--log", CB(arg_handle_log_set), ba);
BLI_args_add(ba, NULL, "--log-level", CB(arg_handle_log_level_set), ba);
BLI_args_add(ba, NULL, "--log-show-basename", CB(arg_handle_log_show_basename_set), ba);
BLI_args_add(ba, NULL, "--log-show-backtrace", CB(arg_handle_log_show_backtrace_set), ba);
BLI_args_add(ba, NULL, "--log-show-timestamp", CB(arg_handle_log_show_timestamp_set), ba);
BLI_args_add(ba, NULL, "--log-file", CB(arg_handle_log_file_set), ba);
BLI_args_add(ba, "-d", "--debug", CB(arg_handle_debug_mode_set), ba);
# ifdef WITH_FFMPEG