Feature #34055
Adapt note on complete removal of all debug output
| Status: | Resolved | Start date: | 2012-02-18 | |
|---|---|---|---|---|
| Priority: | Should have | Due date: | ||
| Assignee: | Chris topher | % Done: | 100% |
|
| Category: | - | |||
| Target version: | - | |||
| Votes: | 0 |
Description
The text currently says "all debug statements must be removed". This is generally correct, but not completely; sometimes it is necessary to have error debug output.
E.g. t3lib_div::getUserObj produces the debug output
debug("Class '" . $class . "' was not prepended with '" . $checkPrefix . "'", 't3lib_div::getUserObj');
The developer will add more debug commands when the PHP code is under development.
At the end a tool should help to remove all debug commands. However there are debug commands which should remain and never be removed.
So I need a hint at the end of the debug command.
E.g.
debug("Class '" . $class . "' was not prepended with '" . $checkPrefix . "'", 't3lib_div::getUserObj'); // must remain
or
debug("Class '" . $class . "' was not prepended with '" . $checkPrefix . "'", 't3lib_div::getUserObj'); // %keep
Then a tool could search and remove all debug commands in the PHP code except the line which have the '%keep' at the end.
or use this convention
debug("* Class '" . $class . "' was not prepended with '" . $checkPrefix . "'", 't3lib_div::getUserObj');
A leading '*' in the debug output means that this is an error debugging.
Associated revisions
[TASK] Adapt note on complete removal of all debug output
The CGL state that all debug output must invariably be removed from the
Core. There are however very rare cases, in which debug statements
should be left and in fact already are left in the Core. Document these
exceptions.
Change-Id: I84d9812dcb052041f0803d7b95d2a4cb4c54fb8c
Resolves: #34055
Reviewed-on: https://review.typo3.org/20909
Reviewed-by: Chris topher
Tested-by: Chris topher
[TASK] Adapt note on complete removal of all debug output
The CGL state that all debug output must invariably be removed from the
Core. There are however very rare cases, in which debug statements
should be left and in fact already are left in the Core. Document these
exceptions.
Change-Id: Ic4041435573a9ffb60e8b6456c9bbf202041c3fe
Resolves: #34055
Reviewed-on: https://review.typo3.org/20913
Reviewed-by: Chris topher
Tested-by: Chris topher
[TASK] Adapt note on complete removal of all debug output
The CGL state that all debug output must invariably be removed from the
Core. There are however very rare cases, in which debug statements
should be left and in fact already are left in the Core. Document these
exceptions.
Change-Id: Ic4041435573a9ffb60e8b6456c9bbf202041c3fe
Resolves: #34055
Reviewed-on: https://review.typo3.org/20913
Reviewed-by: Chris topher
Tested-by: Chris topher
Reviewed-on: https://review.typo3.org/20914
History
Updated by Chris topher 17 days ago
- Subject changed from add a hint after error debugging to Adapt note on complete removal of all debug output
- Status changed from New to Needs Feedback
The manual currently says: "all debug statements must be removed (...)", although there are some in the TYPO3 Core (like the one you mentioned), which are helpful, and which should stay.
To the sentence that generally all debug commands have to be removed we should add a description of the special situation, in which a debug statement is exceptionally allowed to stay.
Why should they stay? What are the special "conditions" (untechnically speaking), which have to be met in order to keep a debug statement?
Maybe something like "when they are useful when developing for the TYPO3 Core (as opposed to in the TYPO3 Core)"?
Updated by Chris topher 4 days ago
- Assignee set to Chris topher
Updated by Gerrit Code Review 4 days ago
- Status changed from Needs Feedback to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20909
Updated by Gerrit Code Review 4 days ago
Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20909
Updated by Gerrit Code Review 4 days ago
Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20909
Updated by Gerrit Code Review 3 days ago
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20912
Updated by Gerrit Code Review 3 days ago
Patch set 1 for branch 4-7 has been pushed to the review server.
It is available at https://review.typo3.org/20913
Updated by Gerrit Code Review 3 days ago
Patch set 1 for branch 4-6 has been pushed to the review server.
It is available at https://review.typo3.org/20914
Updated by Chris topher 3 days ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset b74857baabf12af7d5180296c95a0a7eb47ba410.