Add detailed debug logs to show which source is setting debug to true

parent 74b3cb62
......@@ -37,10 +37,13 @@ def initialize_config(cli_args=None) -> None:
debug_explicitly_set = False
if cli_args and hasattr(cli_args, 'debug') and cli_args.debug:
debug_explicitly_set = True
print(f"DEBUG_CHECK: debug set from CLI args")
elif f'VIDAI_DEBUG' in os.environ:
debug_explicitly_set = True
print(f"DEBUG_CHECK: debug set from environment VIDAI_DEBUG={os.environ['VIDAI_DEBUG']}")
elif 'debug' in initial_config and initial_config['debug'] != DEFAULTS['debug']:
debug_explicitly_set = True
print(f"DEBUG_CHECK: debug set from config file, initial_config['debug']={initial_config['debug']}, DEFAULTS['debug']={DEFAULTS['debug']}")
if not debug_explicitly_set:
# Reset debug to false if not explicitly set via CLI, env, or config file
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment