@@ -682,45 +682,6 @@ func go_log(threadIndex C.uintptr_t, message *C.char, level C.int) {
682682 }
683683}
684684
685- // go_log_attrs is a cgo-exported bridge between PHP and the Go slog logger.
686- //
687- // It is called from C/PHP and must not panic. All errors are reported by
688- // returning a C-allocated error string; on success it returns NULL.
689- //
690- // Parameters:
691- //
692- // threadIndex:
693- // - Index into the phpThreads table, used to retrieve the Go context for
694- // the current PHP request/thread.
695- //
696- // message:
697- // - Pointer to a C string containing the log message bytes. The memory
698- // is owned by the caller and must NOT be freed by Go.
699- //
700- // len:
701- // - Length of the message, in bytes, as seen from C (not including the
702- // terminating NUL). This is passed to C.GoStringN to build the Go string.
703- //
704- // level:
705- // - Numeric log level compatible with slog.Level values. It is cast to
706- // slog.Level inside this function.
707- //
708- // cattrs:
709- // - Pointer to a PHP zval representing an associative array of attributes,
710- // or NULL. When non-NULL, it is converted to map[string]any via GoMap[any]
711- // and then mapped to slog.Attr values (using slog.Any under the hood).
712- //
713- // Return value:
714- //
715- // On success:
716- // - Returns NULL and the message is logged (if the logger is enabled at
717- // the given level).
718- //
719- // On error:
720- // - Returns a non-NULL *C.char pointing to a NUL-terminated error message
721- // allocated with C.CString. The caller is responsible for releasing
722- // this memory.
723- //
724685//export go_log_attrs
725686func go_log_attrs (threadIndex C.uintptr_t , message * C.char , len C.int , level C.int , cattrs * C.zval ) * C.char {
726687 var attrs map [string ]any
0 commit comments