From a3d34aabc60adf6d7491a07f44c394c0b984ba6a Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Thu, 1 Feb 2024 10:28:28 +0100 Subject: [PATCH] Improve logging for Client callable (#2883) --- src/py/flwr/client/app.py | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/py/flwr/client/app.py b/src/py/flwr/client/app.py index 4dc233a5c076..ba20c2fdb7b5 100644 --- a/src/py/flwr/client/app.py +++ b/src/py/flwr/client/app.py @@ -18,7 +18,7 @@ import argparse import sys import time -from logging import INFO, WARN +from logging import DEBUG, INFO, WARN from pathlib import Path from typing import Callable, ContextManager, Optional, Tuple, Union @@ -62,7 +62,12 @@ def run_client() -> None: "the '--root-certificates' option when running in insecure mode, " "or omit '--insecure' to use HTTPS." ) - log(WARN, "Option `--insecure` was set. Starting insecure HTTP client.") + log( + WARN, + "Option `--insecure` was set. " + "Starting insecure HTTP client connected to %s.", + args.server, + ) root_certificates = None else: # Load the certificates if provided, or load the system certificates @@ -71,11 +76,19 @@ def run_client() -> None: root_certificates = None else: root_certificates = Path(cert_path).read_bytes() + log( + DEBUG, + "Starting secure HTTPS client connected to %s " + "with the following certificates: %s.", + args.server, + cert_path, + ) - print(args.root_certificates) - print(args.server) - print(args.dir) - print(args.callable) + log( + DEBUG, + "The Flower client uses `%s` to execute tasks", + args.callable, + ) callable_dir = args.dir if callable_dir is not None: