cleanup logging in multiple functions (#73)

This commit is contained in:
bmc-msft
2020-10-01 23:31:08 -04:00
committed by GitHub
parent 8b6ea9f66b
commit f72543dde2
6 changed files with 18 additions and 11 deletions

View File

@ -58,7 +58,7 @@ def get_storage_account_name_key(account_id: Optional[str] = None) -> Tuple[str,
@cached(ttl=60)
def get_blob_service(account_id: Optional[str] = None) -> BlockBlobService:
logging.info("getting blob container (account_id: %s)", account_id)
logging.debug("getting blob container (account_id: %s)", account_id)
name, key = get_storage_account_name_key(account_id)
service = BlockBlobService(account_name=name, account_key=key)
return service

View File

@ -26,7 +26,7 @@ QueueNameType = Union[str, UUID]
@cached(ttl=60)
def get_queue_client(account_id: str) -> QueueServiceClient:
logging.info("getting blob container (account_id: %s)", account_id)
logging.debug("getting blob container (account_id: %s)", account_id)
name, key = get_storage_account_name_key(account_id)
account_url = "https://%s.queue.core.windows.net" % name
client = QueueServiceClient(
@ -36,6 +36,7 @@ def get_queue_client(account_id: str) -> QueueServiceClient:
return client
@cached(ttl=60)
def get_queue_sas(
queue: QueueNameType,
*,
@ -45,7 +46,7 @@ def get_queue_sas(
update: bool = False,
process: bool = False,
) -> str:
logging.info("getting queue sas %s (account_id: %s)", queue, account_id)
logging.debug("getting queue sas %s (account_id: %s)", queue, account_id)
name, key = get_storage_account_name_key(account_id)
expiry = datetime.datetime.utcnow() + datetime.timedelta(days=30)

View File

@ -20,7 +20,7 @@ def get_client(
if account_id is None:
account_id = os.environ["ONEFUZZ_FUNC_STORAGE"]
logging.info("getting table account: (account_id: %s)", account_id)
logging.debug("getting table account: (account_id: %s)", account_id)
name, key = get_storage_account_name_key(account_id)
client = TableService(account_name=name, account_key=key)