Format a structured log message as a string suitable for outputting to the terminal (or elsewhere).
This will include the values of all fields it knows how to interpret, which includes `MESSAGE` and `GLIB_DOMAIN` (see the documentation for log_structured). It does not include values from unknown fields.
The returned string does **not** have a trailing new-line character. It is encoded in the character set of the current locale, which is not necessarily UTF-8.
fields |
key–value pairs of structured data forming the log message |
use_color |
true to use ANSI color escape sequences when formatting the message, false to not |
log_level |
log level, either from LogLevelFlags, or a user-defined level |
n_fields |
number of elements in the |
string containing the formatted log message, in the character set of the current locale |