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