Univention Bugzilla – Full Text Bug Listing |
Summary: | turn univention.debug.function into decorator | ||
---|---|---|---|
Product: | UCS | Reporter: | Florian Best <best> |
Component: | univention-debug | Assignee: | Philipp Hahn <hahn> |
Status: | CLOSED FIXED | QA Contact: | Florian Best <best> |
Severity: | normal | ||
Priority: | P5 | CC: | hahn, requate |
Version: | UCS 4.4 | ||
Target Milestone: | UCS 4.4-0-errata | ||
Hardware: | Other | ||
OS: | Linux | ||
See Also: | https://forge.univention.org/bugzilla/show_bug.cgi?id=48893 | ||
What kind of report is it?: | Development Internal | What type of bug is this?: | --- |
Who will be affected by this bug?: | --- | How will those affected feel about the bug?: | --- |
User Pain: | Enterprise Customer affected?: | ||
School Customer affected?: | ISV affected?: | ||
Waiting Support: | Flags outvoted (downgraded) after PO Review: | ||
Ticket number: | Bug group (optional): | API change, Error handling, Further conceptual development, Usability | |
Max CVSS v3 score: | |||
Attachments: |
patch / script
Add univention.debug decorator |
Description
Florian Best
2017-01-25 16:59:44 CET
It would also fix these stupid messages which slow down every time I want to commit something: management/univention-directory-manager-modules/modules/univention/admin/handlers/__init__.py:267: local variable '_d' is assigned to but never used management/univention-directory-manager-modules/modules/univention/admin/handlers/__init__.py:1057: local variable '_d' is assigned to but never used management/univention-directory-manager-modules/modules/univention/admin/handlers/__init__.py:2729: local variable '_d' is assigned to but never used It would also be nice to let the decorator make something like '__ucs_func_name' available, so it can be used easily in debug messages. Created attachment 8377 [details]
patch / script
Running the scripts gives e.g. this output:
26.01.17 14:57:23.642 DEBUG_INIT
UNIVENTION_DEBUG_BEGIN : foo
UNIVENTION_DEBUG_END : foo
UNIVENTION_DEBUG_BEGIN : __main__.bar(('x', 'y', 'z'), {'blub': 1})
UNIVENTION_DEBUG_END : __main__.bar(('x', 'y', 'z'), {'blub': 1})
UNIVENTION_DEBUG_BEGIN : __main__.Baz.baz()
UNIVENTION_DEBUG_END : __main__.Baz.baz() -> 1
Created attachment 9743 [details]
Add univention.debug decorator
Also log exception.
Make output format for parameters and return values configurabel: str, repr, ...
Add Sphinx DocString.
Updated patch is part of my git:phahn/46100_debug2 tree: https://git.knut.univention.de/univention/ucs/commit/87e7efc024ba21965f95249f60d46e31ea69da30 [4.4-0] d57be2fe6c Bug #43422 debug.py: logging function decorator Package: univention-debug-python Version: 1.0.0-1A~4.4.0.201905201332 Branch: ucs_4.4-0 Scope: errata4.4-0 [4.4-0] f78f7c4d55 Bug #49130: univention-debug 11.0.0-2A~4.4.0.201905171721 Bug #49130: univention-debug-python 1.0.0-1A~4.4.0.201905201308 doc/errata/staging/univention-debug-python.yaml | 13 +++++++++++++ doc/errata/staging/univention-debug.yaml | 11 +++++++++++ doc/errata/staging/univention-python.yaml | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) Introduce decorator "@univention.debug.trace()" to start deprecating "function" together with the transition from "python-support" to "pybuild" and to "Python3". See Bug #48893 for some un-fix(ed|able) issues. OK: YAML OK: decorator OK: no warning is printed when using the old ud.function(). |