Skip to content

logger: remove unused trace decorator and TraceRepr class#503

Open
Akshay-krish wants to merge 1 commit intosugarlabs:masterfrom
Akshay-krish:remove-unused-trace-logic
Open

logger: remove unused trace decorator and TraceRepr class#503
Akshay-krish wants to merge 1 commit intosugarlabs:masterfrom
Akshay-krish:remove-unused-trace-logic

Conversation

@Akshay-krish
Copy link
Copy Markdown

This PR removes the unused trace decorator, its internal helper functions, and the TraceRepr class from logger.py.

TECHNICAL DETAILS:
Verified that no other modules in the toolkit use the @trace decorator or TraceRepr class using grep.
Removed the TRACE log level constant and its registration.
Removed the unused import decorator dependency.
Verified file integrity with python -m py_compile.

Related Issue
Fixes #464

@chimosky
Copy link
Copy Markdown
Member

6fc982a has nothing to do with the issue you're trying to fix, I don't see why it's there.

You've also made the mistake of assuming what exists in the toolkit is only used in the toolkit, and that isn't true.

The toolkit is consumed by Sugar and sugar-datastore, you'll have to check if any of those use this before concluding that it's not used anywhere.

What's the advantage of verifying file integrity when fixing this issue?

@Akshay-krish Akshay-krish force-pushed the remove-unused-trace-logic branch from e70a54e to 174cd5d Compare February 18, 2026 15:37
Remove the @trace decorator and TraceRepr helper class as they are no longer used. Also remove the trace log level (5) and drop the external decorator library dependency. Verified no usage in sugar or sugar-datastore. Fixes sugarlabs#464
@Akshay-krish Akshay-krish force-pushed the remove-unused-trace-logic branch from 174cd5d to 7a64420 Compare February 18, 2026 16:08
@Akshay-krish
Copy link
Copy Markdown
Author

Thank you for the feedback, @chimosky.

I have addressed the points raised:

External Usage: I checked the sugarlabs/sugar and sugarlabs/sugar-datastore repositories. I confirmed that neither repository utilizes the @trace decorator or the TraceRepr class, so removing them is safe for the consumers of the toolkit.

Clean History: I performed a git reset --hard to remove the unrelated commits (like 6fc982a) and the security fixes that were accidentally pulled in. This PR now contains exactly one commit with the correct changes.

Validation: I agree that py_compile was not a meaningful metric here. I have instead focused on removing the unused import decorator dependency and ensuring the TRACE constant is no longer referenced anywhere in the module to avoid NameError issues.

The PR is now clean and ready for review.

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.

logger.trace unused

2 participants