Building the per-request INC and RESPONSE debug log strings (basename(),
implode() and string concatenation) on every poll is wasteful when debug
logging is disabled, which is the normal production configuration.
Introduce testable helpers in lib/functions.php:
- cacti_effective_log_level() resolves the effective verbosity the same way
cacti_log() does (selective per-file/per-plugin override, else log_verbosity).
- script_server_log_request() / script_server_log_response() only assemble and
emit their debug strings when that level is POLLER_VERBOSITY_DEBUG.
script_server.php now calls these helpers instead of building the strings
inline, so the hot path stays cheap while selective script-server debugging
keeps working. Unit coverage is added for the new helpers.
This is the develop counterpart of the 1.2.x change in #8585.
Co-authored-by: TheWitness <copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>