Project

General

Profile

Actions

Feature #86220

closed

enhanced debug methods

Added by Franz Holzinger over 5 years ago. Updated over 5 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
Logging
Target version:
-
Start date:
2018-09-10
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

The debug function at typo3_src-9.3.3/typo3/sysext/core/Resources/PHP/GlobalDebugFunctions.php is not sufficient for big TYPO3 extensions. If you have more than 1000 debug entries then the generated debug output will be too much. And it takes too long time to search for anything in the debug output.

In TYPO3 before 9.3 there have been 2 useful debug functions:

debugBegin
debugEnd

They should be kept for compatibility reason or at least be substituted by a similar function.

debugBegin has been a starting control to turn the debug output on. debugEnd has been a stop marker for the debug output.

However a more sophisticated method would help for better debugging.

debugControl with an indefinite number of parameters.

There you can set attributes for the output like colors, text sizes, email adresses, extension keys of a person who needs to be notified with debug details if a special part of code has been entered. This could also make it possible to define in a debug extension, that only the output of extension news is generated. If a debugControl(START, EXT_KEY, 'news'); has been executed, then this signifies the start of the debug output for extension news. debugControl(END, EXT_KEY, 'news'); marks the end for news.

All these code functions needs not be implemented in TYPO3. However the empty functions and an extensibility by slots are needed.

And also a return value of debug should be given.
A negative value could mean that the program execution should be shorter than normal.

debug($a, 'variable $a');

The debug extension could determine that if $a == 'special' then the program execution should return. Even a user with a special front end user group or IP address could have less debug output than another user. E.g. you want to test a new PHP code which must only be executed by a special tester. Other persons should never run into the PHP code which is not stable enough. If an email address '' has been entered, then the following code should be executed, otherwise not.

Then the caller could run:

if (debug($a, 'variable $a') < 0) return;
if (debugControl(TEST_USER) < 0) return;

Maybe some constants for this could be defined with TYPO3.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #23899: add a control function for debuggingClosed2010-11-01

Actions
Actions

Also available in: Atom PDF