diff --git a/sanic/application/motd.py b/sanic/application/motd.py index eb0e3df7..eb12f277 100644 --- a/sanic/application/motd.py +++ b/sanic/application/motd.py @@ -73,6 +73,14 @@ class MOTDTTY(MOTD): self.value_width = min( max(map(len, self.data.values())), self.max_value_width ) + if self.extra: + self.key_width = max( + self.key_width, max(map(len, self.extra.keys())) + ) + self.value_width = min( + max((*map(len, self.extra.values()), self.value_width)), + self.max_value_width, + ) self.logo_lines = self.logo.split("\n") if self.logo else [] self.logo_line_length = 24 self.centering_length = ( diff --git a/sanic/mixins/startup.py b/sanic/mixins/startup.py index f6b5630e..c3c697a0 100644 --- a/sanic/mixins/startup.py +++ b/sanic/mixins/startup.py @@ -3,7 +3,6 @@ from __future__ import annotations import os import platform import sys - from asyncio import ( AbstractEventLoop, CancelledError, @@ -71,7 +70,6 @@ from sanic.worker.multiplexer import WorkerMultiplexer from sanic.worker.reloader import Reloader from sanic.worker.serve import worker_serve - if TYPE_CHECKING: from sanic import Sanic from sanic.application.state import ApplicationState @@ -90,6 +88,7 @@ else: # no cov class StartupMixin(metaclass=SanicMeta): _app_registry: ClassVar[Dict[str, Sanic]] + name: str config: Config listeners: Dict[str, List[ListenerType[Any]]] state: ApplicationState @@ -605,6 +604,7 @@ class StartupMixin(metaclass=SanicMeta): server = "ASGI" if self.asgi else "unknown" # type: ignore display = { + "app": self.name, "mode": " ".join(mode), "server": server, "python": platform.python_version(),