fix ipv6 display in startup info log (#2285)
* fix ipv6 display in startup info log * refactored to oneliner by request * Added test for passing ipv4 host * Added test for passing ipv6 any host * Added test for passing ipv6 loopback host
This commit is contained in:
@@ -1337,7 +1337,9 @@ class Sanic(BaseSanic, metaclass=TouchUpMeta):
|
||||
if unix:
|
||||
logger.info(f"Goin' Fast @ {unix} {proto}://...")
|
||||
else:
|
||||
logger.info(f"Goin' Fast @ {proto}://{host}:{port}")
|
||||
# colon(:) is legal for a host only in an ipv6 address
|
||||
display_host = f"[{host}]" if ":" in host else host
|
||||
logger.info(f"Goin' Fast @ {proto}://{display_host}:{port}")
|
||||
|
||||
debug_mode = "enabled" if self.debug else "disabled"
|
||||
reload_mode = "enabled" if auto_reload else "disabled"
|
||||
|
||||
Reference in New Issue
Block a user