[go: up one dir, main page]

sp-style-elem.cpp: print log messages with GLib logging instead of directly on stdout

This MR changes all logging in src/object/sp-style-elem.cpp to stdout to log to stderr instead using std::cerr or GLib logging (g_info, g_warning or g_error) where appropiate.

Use case:

When using inkscape as a command line interface (CLI) and piping output to stdout (e.g. via --export-filename=-) error messages or warnings also printed to stdout would end up in and corrupt the final exported file.
In this case the input svg contained a style element with a @font-face directive and thus the resulting svg started with a warning that about limited font-face rule support.

see #1625 (comment 675428516)

To be discussed:

  • Some of the offending logging messages seem like notices from development/debugging. Which if them are worth keeping and which should maybe left commented out?
  • I primarily chose GLib logging to allow to convey additional meaning via the log levels as opposed to std::cerr - is there a preference?
  • Is the formatting ok? adjusted mostly like the Codequality job recommended.
Edited by Maximilian Stendler

Merge request reports

Loading