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

Log locust-cloud version if it is installed #2916

Merged
merged 1 commit into from
Sep 27, 2024
Merged
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
7 changes: 6 additions & 1 deletion locust/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import atexit
import errno
import gc
import importlib.metadata
import inspect
import json
import logging
Expand Down Expand Up @@ -44,7 +45,10 @@
raise
try:
import locust_cloud # pyright: ignore[reportMissingImports]

locust_cloud_version = f" (locust-cloud {importlib.metadata.version('locust-cloud')})"
except ModuleNotFoundError as e:
locust_cloud_version = ""
if e.msg != "No module named 'locust_cloud'":
raise

Expand Down Expand Up @@ -200,7 +204,8 @@ def is_valid_percentile(parameter):

children = []
logger = logging.getLogger(__name__)
logger.info(f"Starting Locust {version}")

logger.info(f"Starting Locust {version}{locust_cloud_version}")

if options.processes:
if os.name == "nt":
Expand Down
Loading