diff --git a/music_kraken/objects/parents.py b/music_kraken/objects/parents.py index 53bc5bc..4e87cfb 100644 --- a/music_kraken/objects/parents.py +++ b/music_kraken/objects/parents.py @@ -194,7 +194,7 @@ class OuterProxy: if len(b._inner._refers_to_instances) > len(a._inner._refers_to_instances): a, b = b, a - object_trace(f"merging {type(a).__name__} [{a.title_string} | {a.id}] with {type(b).__name__} [{b.title_string} | {b.id}] called by [{' | '.join(f'{s.function} {Path(s.filename).name}:{str(s.lineno)}' for s in inspect.stack()[1:5])}]") + object_trace(f"merging {type(a).__name__} [{a.title_string} | {a.id}] with {type(b).__name__} [{b.title_string} | {b.id}]") for collection, child_collection in b._inner._is_collection_child.items(): try: diff --git a/music_kraken/utils/__init__.py b/music_kraken/utils/__init__.py index 96b4379..b9715e3 100644 --- a/music_kraken/utils/__init__.py +++ b/music_kraken/utils/__init__.py @@ -3,7 +3,7 @@ from pathlib import Path import json import logging -from .shared import DEBUG, DEBUG_LOGGING, DEBUG_DUMP, DEBUG_TRACE, DEBUG_OBJECT_TRACE +from .shared import DEBUG, DEBUG_LOGGING, DEBUG_DUMP, DEBUG_TRACE, DEBUG_OBJECT_TRACE, DEBUG_OBJECT_TRACE_CALLSTACK from .config import config, read_config, write_config from .enums.colors import BColors from .path_manager import LOCATIONS @@ -56,7 +56,8 @@ def object_trace(obj): if not DEBUG_OBJECT_TRACE: return - output("object: " + str(obj), BColors.GREY) + appendix = f" called by [{' | '.join(f'{s.function} {Path(s.filename).name}:{str(s.lineno)}' for s in inspect.stack()[1:5])}]" if DEBUG_OBJECT_TRACE_CALLSTACK else "" + output("object: " + str(obj) + appendix, BColors.GREY) """ diff --git a/music_kraken/utils/shared.py b/music_kraken/utils/shared.py index b3f30e5..638e6a4 100644 --- a/music_kraken/utils/shared.py +++ b/music_kraken/utils/shared.py @@ -15,10 +15,11 @@ __stage__ = os.getenv("STAGE", "prod") DEBUG = (__stage__ == "dev") and True DEBUG_LOGGING = DEBUG and False DEBUG_TRACE = DEBUG and True -DEBUG_OBJECT_TRACE = DEBUG and False +DEBUG_OBJECT_TRACE = DEBUG and True +DEBUG_OBJECT_TRACE_CALLSTACK = DEBUG and False DEBUG_YOUTUBE_INITIALIZING = DEBUG and False DEBUG_PAGES = DEBUG and False -DEBUG_DUMP = DEBUG and True +DEBUG_DUMP = DEBUG and False if DEBUG: print("DEBUG ACTIVE")