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

Use log.exception in run_job failure case #2549

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
3 changes: 1 addition & 2 deletions hydra/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os
import re
import sys
import traceback
from contextlib import contextmanager
from dataclasses import dataclass
from datetime import datetime
Expand Down Expand Up @@ -189,7 +188,7 @@ def run_job(
except Exception as e:
name = "HYDRA_FULL_ERROR"
if name in os.environ and os.environ[name] == "1":
log.info(traceback.format_exc())
log.exception("Got error while running job")
Comment on lines -192 to +191
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using log.exception takes care of printing the traceback.

ret.return_value = e
ret.status = JobStatus.FAILED

Expand Down