Skip to content

Commit

Permalink
Merge pull request #2662 from camptocamp/index-error
Browse files Browse the repository at this point in the history
Add more information in the debug logs
  • Loading branch information
sbrunner authored Dec 18, 2024
2 parents 6e8f43e + 9361726 commit 37ea61d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 6 additions & 0 deletions tilecloud_chain/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,12 @@ def __call__(self, config_file: str, layer_name: str) -> TileStore | None:
)
return None

def __str__(self) -> str:
return self.__class__.__name__

def __repr__(self) -> str:
return self.__str__()


def detach() -> None:
"""Detach to the parent process."""
Expand Down
10 changes: 6 additions & 4 deletions tilecloud_chain/multitilestore.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,15 @@ def apply(key: tuple[str, str], tiles: Iterator[Tile]) -> Iterator[Tile]:

def __str__(self) -> str:
"""Return a string representation of the object."""
stores = {str(store) for store in self.stores.values() if store is not None}
return f"{self.__class__.__name__}({', '.join(stores)})"
stores = {str(store) for store in self.stores.values()}
keys = {f"{config_file}/{layer}" for config_file, layer in self.stores}
return f"{self.__class__.__name__}({', '.join(stores)} - {', '.join(keys)})"

def __repr__(self) -> str:
"""Return a string representation of the object."""
stores = {repr(store) for store in self.stores.values() if store is not None}
return f"{self.__class__.__name__}({', '.join(stores)})"
stores = {repr(store) for store in self.stores.values()}
keys = {f"{config_file}/{layer}" for config_file, layer in self.stores}
return f"{self.__class__.__name__}({', '.join(stores)} - {', '.join(keys)})"

@staticmethod
def _get_layer(tile: Tile | None) -> tuple[str, str]:
Expand Down
4 changes: 2 additions & 2 deletions tilecloud_chain/timedtilestore.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ def get_cheap_bounding_pyramid(self) -> BoundingPyramid | None:

def __str__(self) -> str:
"""Get string representation."""
return f"{self.__class__.__name__}({self._tile_store}"
return f"{self.__class__.__name__}({self._store_name}: {self._tile_store}"

def __repr__(self) -> str:
"""Get string representation."""
return f"{self.__class__.__name__}({self._tile_store!r})"
return f"{self.__class__.__name__}({self._store_name}: {self._tile_store!r})"

0 comments on commit 37ea61d

Please sign in to comment.