Issue #69: add logging.

This commit is contained in:
Sergey Vartanov 2021-08-16 05:13:42 +03:00
parent edd3512526
commit 8fe2f15663
3 changed files with 14 additions and 0 deletions

View file

@ -78,10 +78,14 @@ class Tiles:
file_path: Path = tile.get_file_name(directory)
if not file_path.exists():
tile.draw_for_map(map_, directory)
else:
logging.info(f"File {file_path} already exists.")
output_path: Path = file_path.with_suffix(".png")
if not output_path.exists():
rasterize(file_path, output_path)
else:
logging.info(f"File {output_path} already exists.")
def draw_image(self, cache_path: Path) -> None:
"""
@ -130,12 +134,17 @@ class Tiles:
)
painter.draw(constructor)
logging.info(f"Writing output SVG {output_path}...")
with output_path.open("w+") as output_file:
svg.write(output_file)
else:
logging.info(f"File {output_path} already exists.")
png_path: Path = cache_path / f"{self.boundary_box.get_format()}.png"
if not png_path.exists():
rasterize(output_path, png_path)
else:
logging.info(f"File {png_path} already exists.")
@dataclass