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

log exit code and pid on verbose-verbose logging #10031

Merged
merged 1 commit into from
Oct 18, 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
8 changes: 7 additions & 1 deletion dvc/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ def main(argv=None): # noqa: C901, PLR0912, PLR0915
args = None

outer_log_level = logger.level
level = None
try:
args = parse_args(argv)

level = None
if args.quiet:
level = logging.CRITICAL
elif args.verbose == 1:
Expand Down Expand Up @@ -235,11 +235,17 @@ def main(argv=None): # noqa: C901, PLR0912, PLR0915
ret = _log_exceptions(exc) or 255

try:
import os

from dvc import analytics

if analytics.is_enabled():
analytics.collect_and_send_report(args, ret)

logger.trace( # type: ignore[attr-defined]
"Process %s exiting with %s", os.getpid(), ret
)

return ret
finally:
logger.setLevel(outer_log_level)
Expand Down