From ae15d2f3f4e0280034514925cd280b07284f5a05 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 10 Jul 2024 22:57:19 +0900 Subject: [PATCH] Add debug mode to RayAOP extension A debug output toggle has been introduced to the RayAOP extension. This allows for conditional output of debug information, which may assist in troubleshooting issues with the extension. The output can be controlled using the --enable-rayaop-debug option during the configuration process. --- config.m4 | 7 +++++++ rayaop.c | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/config.m4 b/config.m4 index 4244685..5284eb2 100644 --- a/config.m4 +++ b/config.m4 @@ -38,7 +38,14 @@ if test "$PHP_RAYAOP" != "no"; then PHP_ARG_ENABLE(rayaop-quiet, whether to suppress experimental notices, [ --enable-rayaop-quiet Suppress experimental notices], no, yes) + PHP_ARG_ENABLE(rayaop-debug, whether to enable debug output, + [ --enable-rayaop-debug Enable debug output], no, yes) + if test "$PHP_RAYAOP_QUIET" != "no"; then AC_DEFINE(RAYAOP_QUIET, 1, [Whether to suppress experimental notices]) fi + + if test "$PHP_RAYAOP_DEBUG" != "no"; then + AC_DEFINE(RAYAOP_DEBUG, 1, [Whether to enable debug output]) + fi fi diff --git a/rayaop.c b/rayaop.c index 6249c3a..4fc33be 100644 --- a/rayaop.c +++ b/rayaop.c @@ -8,6 +8,10 @@ #define RAYAOP_QUIET 0 #endif +#ifndef RAYAOP_DEBUG +#define RAYAOP_DEBUG 0 +#endif + #include "php_rayaop.h" /* Include header file for RayAOP extension */ /* Declaration of module global variables */