clan-cli: Refactor ssh part 2, Refactor custom_logger

This commit is contained in:
Qubasa
2024-11-22 22:08:50 +01:00
parent 05b31c7195
commit 8866a85765
23 changed files with 713 additions and 1255 deletions

View File

@@ -48,6 +48,18 @@ class Machine:
def __repr__(self) -> str:
return str(self)
def debug(self, msg: str, *args: Any, **kwargs: Any) -> None:
kwargs.update({"extra": {"command_prefix": self.name}})
log.debug(msg, *args, **kwargs)
def info(self, msg: str, *args: Any, **kwargs: Any) -> None:
kwargs.update({"extra": {"command_prefix": self.name}})
log.info(msg, *args, **kwargs)
def error(self, msg: str, *args: Any, **kwargs: Any) -> None:
kwargs.update({"extra": {"command_prefix": self.name}})
log.error(msg, *args, **kwargs)
@property
def system(self) -> str:
# We filter out function attributes because they are not serializable.