Skip to content

Commit d62e716

Browse files
authored
fix: change logging level to debug for AICORE configuration details (#27)
1 parent 250e606 commit d62e716

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

src/sap_cloud_sdk/aicore/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,8 @@ def set_aicore_config(instance_name: str = "aicore-instance") -> None:
134134
if resource_group:
135135
os.environ["AICORE_RESOURCE_GROUP"] = resource_group
136136

137-
# Log configuration (excluding sensitive information)
138-
logger.info(f"AICORE_AUTH_URL: {auth_url}")
139-
logger.info(f"AICORE_BASE_URL: {base_url}")
140-
logger.info(f"AICORE_RESOURCE_GROUP: {resource_group}")
137+
# Log configuration completion (excluding sensitive information)
138+
logger.info("AI Core configuration has been set successfully")
141139

142140

143141
__all__ = ["set_aicore_config"]

tests/aicore/unit/test_aicore.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ def test_set_config_calls_get_secret_with_correct_parameters(self):
561561
)
562562

563563
def test_set_config_logs_configuration(self):
564-
"""Test that configuration is logged (excluding sensitive information)."""
564+
"""Test that configuration completion is logged (excluding sensitive information)."""
565565
with patch("sap_cloud_sdk.aicore._get_secret") as mock_get_secret, patch(
566566
"sap_cloud_sdk.aicore._get_aicore_base_url"
567567
) as mock_get_base_url, patch.dict("os.environ", {}, clear=True), patch(
@@ -577,11 +577,9 @@ def test_set_config_logs_configuration(self):
577577

578578
set_aicore_config()
579579

580-
# Verify logging was called
580+
# Verify info logging was called with success message
581581
info_calls = [str(call) for call in mock_logger.info.call_args_list]
582-
assert any("AICORE_AUTH_URL" in call for call in info_calls)
583-
assert any("AICORE_BASE_URL" in call for call in info_calls)
584-
assert any("AICORE_RESOURCE_GROUP" in call for call in info_calls)
582+
assert any("AI Core configuration has been set successfully" in call for call in info_calls)
585583

586584
# Verify sensitive info is not logged
587585
all_log_calls = str(mock_logger.mock_calls)

0 commit comments

Comments
 (0)