feat: add `frankenphp_log()` PHP function by raphaelcoeffic · Pull Request #1979 · php/frankenphp

Actually, I wonder if we couldn't just update your PR to provide a single function having this API:

/**
 * @param int $level The importance or severity of a log event. The higher the level, the more important or severe the event. Common levels are -4 for debug, 0 for info, 4 for warn, and 8 for error. For more details, see: https://pkg.go.dev/log/slog#Level
 * array<string, any> $context Values of the array will be converted to the corresponding Go type (if supported by FrankenPHP) and added to the context of the structured logs using https://pkg.go.dev/log/slog#Attr
 */
frankenphp_log(string $message, int $level = 0, array $context = []);

This will provide the low-level brick to have PSR-3 and similar implementations user-land.
We could even patch Monolog to add support for this.

This will also keep full compatibility with Go and Caddy logging systems, as well as with OpenTelemetry, because of the more open log level.

WDYT?