What this solution does
The DevDebug module is designed for the development stage in the 1C-Bitrix DEV environment. While its use in a PROD environment is permissible, it is recommended to remove the module before deploying to production.
After installation, helper functions become available in all scripts immediately after the prologue is executed:
d(mixed $data, bool $hideHeader = false)
Outputs data with formatting.
$data — data to output.
$hideHeader — parameter to hide the path to the script that called the function.
dd(mixed $data)
Outputs data and pauses runtime execution.
$data — data to output.
benchmark(string $action = 'start', ?string $key = null, ?string $mode = 'dump')
A diagnostic function for outputting debugging information. It displays:
- maximum memory consumption between calls;
- code execution time between calls;
- SQL query execution time between calls;
- number of SQL queries between calls.
$action — action 'start' or 'stop' to begin or stop data collection.
$key — key for managing different instances of the function.
$mode — output mode 'dump' or 'log' (via echo() or to a log file).
dbgLog(mixed $data, bool $trace = false, bool $append = true)
The module provides rapid debugging by generating a log file adjacent to the script that triggered the logging function. Each entry records the date and time, a backtrace in file:line format, and the logged data.
Parameters:
$data — data to be logged.
$trace — flag to include a backtrace in file:line format.
$append — mode of operation: append to the file or overwrite it.
$path — path for saving the log file.
Full documentation with usage examples becomes available in the Administration > Services > SadCat88 > [sc88.devdbg] DevDebug section immediately after module installation.
General iT can install “DevDebug - debugging for developers”, configure its settings and verify its operation in the existing project.