Skip to content

Add support for GLib.log_set_writer_func

Evan Welsh requested to merge ewlsh/glogfield-support into master

I discovered this gap in our bindings when attempting to test !634 (merged) which uses structured logging. You can't currently override the logging handler or utilize some APIs from JS due to GLogField being a bare struct with constpointer.

The struct does have defined behavior: its pointer is a null-terminated string when length is -1 and binary data otherwise.

Knowing this we can create a wrapper in GjsPrivate which passes a variant version of all of this.

Edited by Evan Welsh

Merge request reports