Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

user-friendly logging #339

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions mlcube/mlcube/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ def configure(mlcube: t.Optional[str], platform: str, p: t.Tuple[str]) -> None:
runner.configure()
except MLCubeError as err:
exit_code = err.context.get("code", 1) if isinstance(err, ExecutionError) else 1
logger.exception(f"Failed to configure MLCube with error code {exit_code}.")
print(f"Failed to configure MLCube with error code {exit_code}.")
if isinstance(err, ExecutionError):
print(err.describe())
logger.exception(err.describe())
sys.exit(exit_code)
logger.info(
"MLCube (%s) has been successfully configured for `%s` platform.",
Expand Down Expand Up @@ -378,9 +378,9 @@ def run(
runner.run()
except MLCubeError as err:
exit_code = err.context.get("code", 1) if isinstance(err, ExecutionError) else 1
logger.exception(f"run failed to run MLCube with error code {exit_code}.")
print(f"run failed to run MLCube with error code {exit_code}.")
if isinstance(err, ExecutionError):
print(err.describe())
logger.exception(err.describe())
sys.exit(exit_code)


Expand Down Expand Up @@ -673,8 +673,8 @@ def inspect(

yaml.dump(info, sys.stdout)
except MLCubeError as err:
print("MLCube inspect failed")
logger.exception(err)
print(str(err))
exit(1)


Expand Down
Loading