Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more information in the debug logs #2662

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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})"
Loading