Skip to content

Set IDOM_DEBUG_MODE to settings.py:DEBUG #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

Archmonger
Copy link
Contributor

fix #29

@Archmonger Archmonger requested a review from a team as a code owner January 12, 2022 09:22
@rmorshea
Copy link
Contributor

The IDOM_DEBUG_MODE option may need some reworking. The value gets loaded on the first import of idom and can't be changed after that. At the moment many usages of IDOM_DEBUG_MODE in idom look like this:

def some_function():
    ...
    
if IDOM_DEBUG_MODE.current:
    _some_function = some_function

    def some_function():
        # do some debug check
        _some_function()

Instead of:

def some_function():
    if IDOM_DEBUG_MODE.current:
        # do some debug check
    ...

In retrospect trying to avoid if IDOM_DEBUG_MODE.current checks at runtime was a rather silly optimization.

@Archmonger
Copy link
Contributor Author

That's okay for now.
I'll open a PR in IDOM core to change this behavior, and then bump the IDOM version in this repo at a later date.

@Archmonger
Copy link
Contributor Author

From a Django IDOM perspective, I think this one can be merged.

Changing the behavior in core can be done separately.

@rmorshea
Copy link
Contributor

Setting os.environ at this point, won't make a different. idom initializes the debug setting once it's imported, so you'd need to set it before the first time idom is ever imported.

@Archmonger Archmonger marked this pull request as draft January 31, 2022 03:25
@Archmonger
Copy link
Contributor Author

Blocked on reactive-python/reactpy#582 so I am converting this to draft.

@Archmonger Archmonger closed this Aug 19, 2022
@Archmonger Archmonger deleted the idom-debug-mode branch January 30, 2024 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set IDOM_DEBUG_MODE to settings.py:DEBUG
2 participants