Skip to content

Commit

Permalink
Update flwr log stream argument
Browse files Browse the repository at this point in the history
  • Loading branch information
chongshenng committed Jul 25, 2024
1 parent e1bdc7e commit da9518b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/py/flwr/cli/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ def log(
Optional[str],
typer.Argument(help="Name of the federation to run the app on"),
] = None,
follow: Annotated[
stream: Annotated[
bool,
typer.Option(
"--follow/--no-follow",
"-f/-F",
help="Use this flag to follow logstream",
"--stream/--show",
"-s/-p",
help="Flag to stream or print logs from the Flower run",
),
] = True,
) -> None:
Expand Down Expand Up @@ -119,7 +119,7 @@ def log(
raise typer.Exit(code=1)

if "address" in federation:
_log_with_superexec(federation, run_id, follow)
_log_with_superexec(federation, run_id, stream)
else:
pass

Expand All @@ -128,7 +128,7 @@ def log(
def _log_with_superexec(
federation: Dict[str, str],
run_id: int,
follow: bool,
stream: bool,
) -> None:

def on_channel_state_change(channel_connectivity: str) -> None:
Expand Down Expand Up @@ -172,7 +172,7 @@ def on_channel_state_change(channel_connectivity: str) -> None:
)
channel.subscribe(on_channel_state_change)

if follow:
if stream:
try:
while True:
logger(INFO, "Starting logstream for run_id `%s`", run_id)
Expand Down

0 comments on commit da9518b

Please sign in to comment.