Skip to content

Commit

Permalink
Fixed code checks, merged develop and updated some print statements.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhellander committed Nov 13, 2023
1 parent d4b198d commit 2bd9276
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion fedn/cli/run_cmd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import time
import uuid

import click
Expand Down
3 changes: 2 additions & 1 deletion fedn/fedn/common/log_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def set_log_level_from_string(level_str):
# Set the log level
logger.setLevel(level)


def set_log_stream(log_file):
"""
Redirect the log stream to a specified file, if log_file is set.
Expand All @@ -52,4 +53,4 @@ def set_log_stream(log_file):
file_handler.setFormatter(formatter)

# Add the file handler to the logger
logger.addHandler(file_handler)
logger.addHandler(file_handler)
4 changes: 2 additions & 2 deletions fedn/fedn/network/clients/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def _connect(self, client_config):
host = client_config['host']
# Add host to gRPC metadata
self._add_grpc_metadata('grpc-server', host)
print("CLIENT: Using metadata: {}".format(self.metadata), flush=True)
logger.info("Client using metadata: {}.".format(self.metadata), flush=True)
port = client_config['port']
secure = False
if client_config['fqdn'] is not None:
Expand Down Expand Up @@ -530,7 +530,7 @@ def _process_training_request(self, model_id):
os.unlink(outpath+'-metadata')

except Exception as e:
print("ERROR could not process training request due to error: {}".format(
logger.error("Could not process training request due to error: {}".format(
e), flush=True)
updated_model_id = None
meta = {'status': 'failed', 'error': str(e)}
Expand Down

0 comments on commit 2bd9276

Please sign in to comment.