Improved logging closes #180
All checks were successful
Build on push / prepare (push) Successful in 9s
Build on push / query (push) Successful in 17s
Build on push / core (push) Successful in 18s
Build on push / mail (push) Successful in 17s
Build on push / translation (push) Successful in 18s

This commit is contained in:
2025-09-15 23:06:38 +02:00
parent d9d7802f33
commit 62b6435470
35 changed files with 533 additions and 467 deletions

View File

@@ -42,10 +42,10 @@ class Application(ApplicationABC):
if self._configuration.environment.application_name != "":
self._logger.header(f"{self._configuration.environment.application_name}:")
self._logger.debug(__name__, f"Args: {self._configuration.additional_arguments}")
self._logger.debug(__name__, f"Host: {self._configuration.environment.host_name}")
self._logger.debug(__name__, f"Environment: {self._configuration.environment.environment_name}")
self._logger.debug(__name__, f"Customer: {self._configuration.environment.customer}")
self._logger.debug(f"Args: {self._configuration.additional_arguments}")
self._logger.debug(f"Host: {self._configuration.environment.host_name}")
self._logger.debug(f"Environment: {self._configuration.environment.environment_name}")
self._logger.debug(f"Customer: {self._configuration.environment.customer}")
Console.write_line(List(int, range(0, 10)).select(lambda x: f"x={x}").to_list())
Console.spinner("Test", self._wait, 2, spinner_foreground_color="red")
test: TestService = self._services.get_service(TestService)
@@ -69,4 +69,4 @@ class Application(ApplicationABC):
self._configuration.add_json_file(f"appsettings.{self._environment.host_name}.json", optional=True)
test_settings1 = self._configuration.get_configuration(TestSettings)
Console.write_line(test_settings1.value)
# self.test_send_mail()
# self.test_send_mail()

View File

@@ -19,12 +19,8 @@ class Startup(StartupABC):
config.add_json_file(f"appsettings.{config.environment.environment_name}.json")
config.add_json_file(f"appsettings.{config.environment.host_name}.json", optional=True)
return config
def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC) -> ServiceProviderABC:
services.add_singleton(LoggerABC, Logger)
services.add_singleton(EMailClientABC, EMailClient)
services.add_logging()
services.add_mail()
services.add_transient(IPAddressPipe)
services.add_singleton(TestService)
return services.build_service_provider()