update_manager: improve logging
Add a debug logging helper to the base class. Use unique logging prefixes for subclasses of AppDeploy. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
4edfbce3ce
commit
1cfeb853a5
|
@ -48,8 +48,10 @@ DISTRO_ALIASES = [distro.id()]
|
|||
DISTRO_ALIASES.extend(distro.like().split())
|
||||
|
||||
class AppDeploy(BaseDeploy):
|
||||
def __init__(self, config: ConfigHelper, cmd_helper: CommandHelper) -> None:
|
||||
super().__init__(config, cmd_helper, prefix="Application")
|
||||
def __init__(
|
||||
self, config: ConfigHelper, cmd_helper: CommandHelper, prefix: str
|
||||
) -> None:
|
||||
super().__init__(config, cmd_helper, prefix=prefix)
|
||||
self.config = config
|
||||
type_choices = list(TYPE_TO_CHANNEL.keys())
|
||||
self.type = config.get('type').lower()
|
||||
|
|
|
@ -91,6 +91,10 @@ class BaseDeploy:
|
|||
log_msg = f"{self.prefix}{msg}"
|
||||
logging.info(log_msg)
|
||||
|
||||
def log_debug(self, msg: str) -> None:
|
||||
log_msg = f"{self.prefix}{msg}"
|
||||
logging.debug(log_msg)
|
||||
|
||||
def notify_status(self, msg: str, is_complete: bool = False) -> None:
|
||||
log_msg = f"{self.prefix}{msg}"
|
||||
logging.debug(log_msg)
|
||||
|
|
|
@ -30,7 +30,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class GitDeploy(AppDeploy):
|
||||
def __init__(self, config: ConfigHelper, cmd_helper: CommandHelper) -> None:
|
||||
super().__init__(config, cmd_helper)
|
||||
super().__init__(config, cmd_helper, "Git Repo")
|
||||
self._configure_path(config)
|
||||
self._configure_virtualenv(config)
|
||||
self._configure_dependencies(config)
|
||||
|
|
|
@ -36,7 +36,7 @@ RINFO_KEYS = [
|
|||
|
||||
class ZipDeploy(AppDeploy):
|
||||
def __init__(self, config: ConfigHelper, cmd_helper: CommandHelper) -> None:
|
||||
super().__init__(config, cmd_helper)
|
||||
super().__init__(config, cmd_helper, "Zip Dist")
|
||||
self._configure_path(config)
|
||||
self._configure_virtualenv(config)
|
||||
self._configure_dependencies(config, node_only=True)
|
||||
|
|
Loading…
Reference in New Issue