move debug flag into its own global var (G.debug), split up debug options.

--debug
  --debug-ffmpeg
  --debug-python
  --debug-events
  --debug-wm

This makes debug output easier to read - event debug prints would flood output too much before.

For convenience:
  --debug-all turns all debug flags on (works as --debug did before).

also removed some redundant whitespace in debug prints and prefix some prints with __func__ to give some context.
This commit is contained in:
Campbell Barton
2012-03-31 00:59:17 +00:00
parent ebb229110e
commit 5b88712ff9
98 changed files with 453 additions and 410 deletions

View File

@@ -65,7 +65,7 @@ def modules(module_cache):
def fake_module(mod_name, mod_path, speedy=True, force_support=None):
global error_encoding
if _bpy.app.debug:
if _bpy.app.debug_python:
print("fake_module", mod_path, mod_name)
import ast
ModuleType = type(ast)
@@ -284,7 +284,7 @@ def enable(module_name, default_set=True):
mod.__addon_enabled__ = True
if _bpy.app.debug:
if _bpy.app.debug_python:
print("\taddon_utils.enable", mod.__name__)
return mod
@@ -323,7 +323,7 @@ def disable(module_name, default_set=True):
if addon:
addons.remove(addon)
if _bpy.app.debug:
if _bpy.app.debug_python:
print("\taddon_utils.disable", module_name)