Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: add logging for url port and host #304

Merged
merged 2 commits into from
Nov 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions integration_tests/base_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,6 @@ async def redirect_route(request):


if __name__ == "__main__":
ROBYN_URL = os.getenv("ROBYN_URL", "0.0.0.0")
ROBYN_PORT = int(os.getenv("ROBYN_PORT", "5000"))
app.add_header("server", "robyn")
current_file_path = pathlib.Path(__file__).parent.resolve()
app.add_directory(
Expand All @@ -206,4 +204,4 @@ async def redirect_route(request):
index_file="index.html",
)
app.startup_handler(startup_handler)
app.start(port=ROBYN_PORT, url=ROBYN_URL)
app.start(port=5000)
5 changes: 4 additions & 1 deletion robyn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ def start(self, url: str = "127.0.0.1", port: int = 5000):
url = os.getenv("ROBYN_URL", url)
port = int(os.getenv("ROBYN_PORT", port))

logger.info(
"%sStarting server at %s:%s %s", Colors.OKGREEN, url, port, Colors.ENDC
)

def init_processpool(socket):

process_pool = []
Expand Down Expand Up @@ -158,7 +162,6 @@ def init_processpool(socket):

process_pool = init_processpool(socket)

logger.info(f"{Colors.HEADER}Starting up \n{Colors.ENDC}")
logger.info(f"{Colors.OKGREEN}Press Ctrl + C to stop \n{Colors.ENDC}")
try:
for process in process_pool:
Expand Down