Skip to content

Commit 95ea9f5

Browse files
Kiuk Chungfacebook-github-bot
authored andcommitted
(torchx/cli) fix misaligned log msgs for torchx run
Summary: closes: #251 Reviewed By: d4l3k Differential Revision: D31659813 fbshipit-source-id: 150ea152339adf84d19f1eb8b4a2e083901705ab
1 parent 873f509 commit 95ea9f5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

torchx/cli/cmd_run.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ def _builtins(self) -> Dict[str, _Component]:
6666
def run(self, args: argparse.Namespace) -> None:
6767
builtin_components = self._builtins()
6868
num_builtins = len(builtin_components)
69-
logger.info(f"Found {num_builtins} builtin configs:")
69+
print(f"Found {num_builtins} builtin configs:")
7070
for i, component in enumerate(builtin_components.values()):
71-
logger.info(f" {i + 1:2d}. {component.name}")
71+
print(f" {i + 1:2d}. {component.name}")
7272

7373

7474
class CmdRun(SubCommand):
@@ -139,11 +139,12 @@ def _run(self, runner: Runner, args: argparse.Namespace) -> Optional[str]:
139139

140140
if args.dryrun:
141141
app_dryrun_info = cast(specs.AppDryRunInfo, result)
142-
logger.info("=== APPLICATION ===")
143-
logger.info(pformat(asdict(app_dryrun_info._app), indent=2, width=80))
142+
logger.info(
143+
"\n=== APPLICATION ===\n"
144+
f"{pformat(asdict(app_dryrun_info._app), indent=2, width=80)}"
145+
)
144146

145-
logger.info("=== SCHEDULER REQUEST ===")
146-
logger.info(app_dryrun_info)
147+
logger.info("\n=== SCHEDULER REQUEST ===\n" f"{app_dryrun_info}")
147148
return
148149
else:
149150
app_handle = cast(specs.AppHandle, result)
@@ -153,7 +154,6 @@ def _run(self, runner: Runner, args: argparse.Namespace) -> Optional[str]:
153154
if args.scheduler.startswith("local"):
154155
self._wait_and_exit(runner, app_handle)
155156
else:
156-
logger.info("=== RUN RESULT ===")
157157
logger.info(f"Launched app: {app_handle}")
158158
status = runner.status(app_handle)
159159
logger.info(status)

0 commit comments

Comments
 (0)