diff --git a/masque/file/svg.py b/masque/file/svg.py index 148f6d4..859c074 100644 --- a/masque/file/svg.py +++ b/masque/file/svg.py @@ -2,7 +2,7 @@ SVG file format readers and writers """ from collections.abc import Mapping -import warnings +import logging import numpy from numpy.typing import ArrayLike @@ -12,6 +12,9 @@ from .utils import mangle_name from .. import Pattern +logger = logging.getLogger(__name__) + + def writefile( library: Mapping[str, Pattern], top: str, @@ -50,7 +53,7 @@ def writefile( bounds = pattern.get_bounds(library=library) if bounds is None: bounds_min, bounds_max = numpy.array([[-1, -1], [1, 1]]) - warnings.warn('Pattern had no bounds (empty?); setting arbitrary viewbox', stacklevel=1) + logger.warning('Pattern had no bounds (empty?); setting arbitrary viewbox', stacklevel=1) else: bounds_min, bounds_max = bounds @@ -117,7 +120,7 @@ def writefile_inverted( bounds = pattern.get_bounds(library=library) if bounds is None: bounds_min, bounds_max = numpy.array([[-1, -1], [1, 1]]) - warnings.warn('Pattern had no bounds (empty?); setting arbitrary viewbox', stacklevel=1) + logger.warning('Pattern had no bounds (empty?); setting arbitrary viewbox', stacklevel=1) else: bounds_min, bounds_max = bounds