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 |
|---|---|
Fatal parse or render failures |
|
Missing fonts, skipped font files, empty font directories |
|
General pipeline milestones |
|
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.