Skip to content

Commit

Permalink
add trace level logging for available studio config
Browse files Browse the repository at this point in the history
  • Loading branch information
pmrowla committed Aug 21, 2023
1 parent dd5a5dc commit 54032e4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dvc/repo/artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ def get( # noqa: C901
saved_exc: Optional[Exception] = None
if DVC_STUDIO_TOKEN in os.environ:
try:
logger.trace( # type: ignore[attr-defined]
"Trying DVC_STUDIO_TOKEN env-only config"
)
return cls._download_studio(
url,
name,
Expand All @@ -263,7 +266,10 @@ def get( # noqa: C901
)
except Exception as exc: # noqa: BLE001, pylint: disable=broad-except
saved_exc = exc

else:
logger.trace( # type: ignore[attr-defined]
"DVC_STUDIO_TOKEN not set, skipping env-only config"
)
if config and not isinstance(config, dict):
config = Config.load_file(config)
with Repo.open(
Expand All @@ -272,6 +278,7 @@ def get( # noqa: C901
uninitialized=True,
config=config,
) as repo:
logger.trace("Trying repo [studio] config") # type: ignore[attr-defined]
dvc_studio_config = dict(repo.config.get("studio"))
try:
return cls._download_studio(
Expand Down

0 comments on commit 54032e4

Please sign in to comment.