From a3bf5535f6e42ee61d4b53964c33c408a8b7a001 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Mon, 15 Nov 2021 20:38:57 +0100 Subject: [PATCH] Improved BootLog module --- src/modules/__init__.py | 0 src/modules/boot_log/main.py | 28 +++++++++------------------- 2 files changed, 9 insertions(+), 19 deletions(-) create mode 100644 src/modules/__init__.py diff --git a/src/modules/__init__.py b/src/modules/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/modules/boot_log/main.py b/src/modules/boot_log/main.py index f716961..592134f 100644 --- a/src/modules/boot_log/main.py +++ b/src/modules/boot_log/main.py @@ -1,23 +1,13 @@ -from cpl_core.configuration import Configuration, ConfigurationABC -from cpl_core.console import Console -from cpl_core.dependency_injection import ServiceCollection, ServiceProviderABC +from cpl_core.logging import LoggerABC + +from gismo_core.abc.bot_service_abc import BotServiceABC -def configure_configuration() -> ConfigurationABC: - config = Configuration() - return config +class BootLog: + def __init__(self, logger: LoggerABC, bot: BotServiceABC): + self._logger = logger + self._bot = bot -def configure_services(config: ConfigurationABC) -> ServiceProviderABC: - services = ServiceCollection(config) - return services.build_service_provider() - - -def main(): - config = configure_configuration() - provider = configure_services(config) - Console.write_line('Hello World') - - -if __name__ == '__main__': - main() + def on_ready(self): + self._logger.info(__name__, f'Bot started: {self._bot}')