gmessages: Add nullable annotation for log_domain in GLogFunc

Add a missing `(nullable)` annotation for the `log_domain` parameter in the
`GLogFunc` callback. This ensures consistency with the documentation and
usage in functions like `g_log_set_handler`, where `log_domain` can be `NULL`.

Without this annotation, the GIR file generated from the C source does not
reflect the nullability of `log_domain`, leading to potential issues in
language bindings and other introspection-based tools.

This change updates the documentation in `glib/gmessages.c` to include the
nullable annotation and clarifies the expected behavior of the `GLogFunc`
callback.

Fixes #3552
This commit is contained in:
Roberto Leinardi 2024-12-05 16:26:55 +01:00
parent b6da230b8f
commit 1691657cb3
No known key found for this signature in database
GPG Key ID: DAB051957EF63750

View File

@ -129,7 +129,7 @@
/**
* GLogFunc:
* @log_domain: the log domain of the message
* @log_domain: (nullable): the log domain of the message
* @log_level: the log level of the message (including the
* fatal and recursion flags)
* @message: the message to process
@ -143,6 +143,9 @@
* code do not need modifying to add a new-line character to the message if the
* log handler is changed.
*
* The `log_domain` parameter can be set to `NULL` or an empty string to use the default
* application domain.
*
* This is not used if structured logging is enabled; see
* [Using Structured Logging](logging.html#using-structured-logging).
*/