Skip to content

Commit

Permalink
Merge pull request #2916 from locustio/log-locust-cloud-version-if-it…
Browse files Browse the repository at this point in the history
…-is-installed

Log locust-cloud version if it is installed
  • Loading branch information
cyberw authored Sep 27, 2024
2 parents 942534f + 1d8a61e commit 276fa48
Showing 1 changed file with 6 additions and 1 deletion.
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

0 comments on commit 276fa48

Please sign in to comment.