Debugging

Enabling debug logging

Pass log_information=True to svg_to_bytes() to print resvg’s internal warnings and errors to stdout:

import resvg_py

png_bytes = resvg_py.svg_to_bytes(
    svg_string=svg,
    log_information=True,
)

Note

The logger is initialized once per process. Subsequent calls reuse the same logger – the flag only needs to be True on the first call.

What gets logged

Level

When it fires

Error

Fatal parse or render failures

Warning

Missing fonts, skipped font files, empty font directories

Info

General pipeline milestones

Debug

Per-node processing details

Tip

If your SVG renders blank text boxes, enable logging – you’ll see a warning if no fonts were loaded for the requested family.

See also

Exceptions – What errors surface as ValueError. Fonts – How to load fonts so text renders correctly.