[ Version ( since = "2.50" ) ]
public void log_variant (string? log_domain, LogLevelFlags log_levels, Variant fields)

Log a message with structured data, accepting the data within a Variant.

This version is especially useful for use in other languages, via introspection.

The only mandatory item in the fields dictionary is the "MESSAGE" which must contain the text shown to the user.

The values in the fields dictionary are likely to be of type String (g_variant_type_string). Array of bytes (g_variant_type_bytestring) is also supported. In this case the message is handled as binary and will be forwarded to the log writer as such. The size of the array should not be higher than g_maxssize. Otherwise it will be truncated to this size. For other types print will be used to convert the value into a string.

For more details on its usage and about the parameters, see log_structured.



log domain, usually g_log_domain


a dictionary (Variant of the type g_variant_type_vardict) containing the key-value pairs of message data.


log level, either from LogLevelFlags, or a user-defined level

Namespace: GLib
Package: glib-2.0