Format a structured log message and print it to either `stdout` or `stderr`, depending on its log level.
g_log_level_info and g_log_level_debug messages are sent to `stdout`, or to `stderr` if requested by writer_default_set_use_stderr; all other log levels are sent to `stderr`. Only fields which are understood by this function are included in the formatted string which is printed.
If the output stream supports ANSI color escape sequences, they will be used in the output.
A trailing new-line character is added to the log message when it is printed.
This is suitable for use as a LogWriterFunc.
fields |
key–value pairs of structured data forming the log message |
log_level |
log level, either from LogLevelFlags, or a user-defined level |
n_fields |
number of elements in the |
user_data |
user data passed to set_writer_func |
g_log_writer_handled on success, g_log_writer_unhandled otherwise |