diff --git a/codewiki/src/fe/web_app.py b/codewiki/src/fe/web_app.py index 6f5d846b..2ce1b593 100644 --- a/codewiki/src/fe/web_app.py +++ b/codewiki/src/fe/web_app.py @@ -11,6 +11,7 @@ """ import argparse +import logging from fastapi import FastAPI, Request, Form from fastapi.responses import HTMLResponse @@ -19,6 +20,7 @@ from .routes import WebRoutes from .config import WebAppConfig +logger = logging.getLogger(__name__) # Initialize FastAPI app app = FastAPI( @@ -110,11 +112,11 @@ def main(): # Start background worker background_worker.start() - print(f"šŸš€ CodeWiki Web Application starting...") - print(f"🌐 Server running at: http://{args.host}:{args.port}") - print(f"šŸ“ Cache directory: {WebAppConfig.get_absolute_path(WebAppConfig.CACHE_DIR)}") - print(f"šŸ—‚ļø Temp directory: {WebAppConfig.get_absolute_path(WebAppConfig.TEMP_DIR)}") - print("\nPress Ctrl+C to stop the server") + logger.info(f"šŸš€ CodeWiki Web Application starting...") + logger.info(f"🌐 Server running at: http://{args.host}:{args.port}") + logger.info(f"šŸ“ Cache directory: {WebAppConfig.get_absolute_path(WebAppConfig.CACHE_DIR)}") + logger.info(f"šŸ—‚ļø Temp directory: {WebAppConfig.get_absolute_path(WebAppConfig.TEMP_DIR)}") + logger.info("Press Ctrl+C to stop the server") try: uvicorn.run( @@ -125,9 +127,9 @@ def main(): log_level="debug" if args.debug else "info" ) except KeyboardInterrupt: - print("\nšŸ‘‹ Server stopped") + logger.info("šŸ‘‹ Server stopped") background_worker.stop() if __name__ == "__main__": - main() \ No newline at end of file + main()