writer_standard_streams


Description:

[ Version ( since = "2.50" ) ]
[ CCode ( delegate_target = false ) ]
public LogWriterFunc writer_standard_streams

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.

Parameters:

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 fields array

user_data

user data passed to set_writer_func

Returns:

g_log_writer_handled on success, g_log_writer_unhandled otherwise


Namespace: GLib.Log
Package: glib-2.0



2022 vala-language.org