From d9f6fba4dac7fc25d6b89982e4914f353e0f4a94 Mon Sep 17 00:00:00 2001 From: Jarno Ensio Hakulinen Date: Tue, 7 May 2024 10:55:04 -0700 Subject: [PATCH] remove default log file writing --- sdk/azure-ai-assistant/azure/ai/assistant/_version.py | 2 +- .../ai/assistant/management/assistant_config_manager.py | 2 +- .../azure/ai/assistant/management/logger_module.py | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sdk/azure-ai-assistant/azure/ai/assistant/_version.py b/sdk/azure-ai-assistant/azure/ai/assistant/_version.py index 57ace2c..751faa8 100644 --- a/sdk/azure-ai-assistant/azure/ai/assistant/_version.py +++ b/sdk/azure-ai-assistant/azure/ai/assistant/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "0.3.3a1" +VERSION = "0.3.4a1" diff --git a/sdk/azure-ai-assistant/azure/ai/assistant/management/assistant_config_manager.py b/sdk/azure-ai-assistant/azure/ai/assistant/management/assistant_config_manager.py index ba1c753..81fe3c0 100644 --- a/sdk/azure-ai-assistant/azure/ai/assistant/management/assistant_config_manager.py +++ b/sdk/azure-ai-assistant/azure/ai/assistant/management/assistant_config_manager.py @@ -204,7 +204,7 @@ def _set_last_modified_assistant(self): latest_assistant_name = None for assistant_name, assistant_config in self._configs.items(): - file_path = os.path.join(self._config_folder, f"{assistant_name}_assistant_config.json") + file_path = os.path.join(self._config_folder, f"{assistant_name}_assistant_config.yaml") try: mod_time = os.path.getmtime(file_path) diff --git a/sdk/azure-ai-assistant/azure/ai/assistant/management/logger_module.py b/sdk/azure-ai-assistant/azure/ai/assistant/management/logger_module.py index dad3bf4..e108f21 100644 --- a/sdk/azure-ai-assistant/azure/ai/assistant/management/logger_module.py +++ b/sdk/azure-ai-assistant/azure/ai/assistant/management/logger_module.py @@ -36,8 +36,9 @@ def setup_logger() -> logging.Logger: # Environment variable check for console logging log_to_console = os.getenv('ASSISTANT_LOG_TO_CONSOLE', 'false').lower() in ('true', '1', 't') - # Default to file logging if ASSISTANT_LOG_TO_CONSOLE is not 'true' - if not log_to_console: + log_to_file = os.getenv('ASSISTANT_LOG_TO_FILE', 'false').lower() in ('true', '1', 't') + + if log_to_file: # Set the file handler with UTF-8 encoding for file output file_handler = logging.FileHandler('assistant.log', encoding='utf-8') file_handler.setFormatter(formatter)