Skip to content

Commit 8b84541

Browse files
Change from info to debug level (#1026)
2 parents 757abd1 + 6b5a47e commit 8b84541

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

ads/aqua/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/usr/bin/env python
2-
# -*- coding: utf-8 -*-
3-
# Copyright (c) 2024 Oracle and/or its affiliates.
2+
# Copyright (c) 2024, 2025 Oracle and/or its affiliates.
43
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
54

65

76
import os
7+
from logging import getLogger
88

9-
from ads import logger, set_auth
9+
from ads import set_auth
1010
from ads.aqua.common.utils import fetch_service_compartment
1111
from ads.config import OCI_RESOURCE_PRINCIPAL_VERSION
1212

@@ -19,6 +19,7 @@ def get_logger_level():
1919
return level
2020

2121

22+
logger = getLogger(__name__)
2223
logger.setLevel(get_logger_level())
2324

2425

@@ -27,7 +28,6 @@ def set_log_level(log_level: str):
2728

2829
log_level = log_level.upper()
2930
logger.setLevel(log_level.upper())
30-
logger.handlers[0].setLevel(log_level)
3131

3232

3333
if OCI_RESOURCE_PRINCIPAL_VERSION:

ads/common/auth.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ def create_signer(
424424
"signer": signer,
425425
"client_kwargs": client_kwargs,
426426
}
427-
logger.info(f"Using authentication signer type {type(signer)}.")
427+
logger.debug(f"Using authentication signer type {type(signer)}.")
428428
return signer_dict
429429
else:
430430
signer_args = dict(
@@ -492,7 +492,7 @@ def default_signer(client_kwargs: Optional[Dict] = None) -> Dict:
492492
**(client_kwargs or {}),
493493
},
494494
}
495-
logger.info(f"Using authentication signer type {type(signer)}.")
495+
logger.debug(f"Using authentication signer type {type(signer)}.")
496496
return signer_dict
497497
else:
498498
signer_args = dict(
@@ -621,7 +621,7 @@ def create_signer(self) -> Dict:
621621
)
622622

623623
oci.config.validate_config(configuration)
624-
logger.info(f"Using 'api_key' authentication.")
624+
logger.debug(f"Using 'api_key' authentication.")
625625
return {
626626
"config": configuration,
627627
"signer": oci.signer.Signer(
@@ -684,7 +684,7 @@ def create_signer(self) -> Dict:
684684
"signer": oci.auth.signers.get_resource_principals_signer(),
685685
"client_kwargs": self.client_kwargs,
686686
}
687-
logger.info(f"Using 'resource_principal' authentication.")
687+
logger.debug(f"Using 'resource_principal' authentication.")
688688
return signer_dict
689689

690690
@staticmethod
@@ -747,7 +747,7 @@ def create_signer(self) -> Dict:
747747
),
748748
"client_kwargs": self.client_kwargs,
749749
}
750-
logger.info(f"Using 'instance_principal' authentication.")
750+
logger.debug(f"Using 'instance_principal' authentication.")
751751
return signer_dict
752752

753753

@@ -814,7 +814,7 @@ def create_signer(self) -> Dict:
814814
oci.config.from_file(self.oci_config_location, self.oci_key_profile)
815815
)
816816

817-
logger.info(f"Using 'security_token' authentication.")
817+
logger.debug(f"Using 'security_token' authentication.")
818818

819819
for parameter in self.SECURITY_TOKEN_REQUIRED:
820820
if parameter not in configuration:
@@ -883,7 +883,7 @@ def _validate_and_refresh_token(self, configuration: Dict[str, Any]):
883883
)
884884

885885
date_time = datetime.fromtimestamp(time_expired).strftime("%Y-%m-%d %H:%M:%S")
886-
logger.info(f"Session is valid until {date_time}.")
886+
logger.debug(f"Session is valid until {date_time}.")
887887

888888
def _read_security_token_file(self, security_token_file: str) -> str:
889889
"""Reads security token from file.
@@ -1020,10 +1020,10 @@ def __enter__(self):
10201020
"""
10211021
if self.profile:
10221022
ads.set_auth(auth=AuthType.API_KEY, profile=self.profile)
1023-
logger.info(f"OCI profile set to {self.profile}")
1023+
logger.debug(f"OCI profile set to {self.profile}")
10241024
else:
10251025
ads.set_auth(auth=AuthType.RESOURCE_PRINCIPAL)
1026-
logger.info(f"OCI auth set to resource principal")
1026+
logger.debug(f"OCI auth set to resource principal")
10271027
return self
10281028

10291029
def __exit__(self, exc_type, exc_val, exc_tb):

0 commit comments

Comments
 (0)