Repository: modin-project/modin

Issue:
Remove enable_api_only mode in modin logging

In modin LogMode enable_api_only and enable options looks confusing. We should just leave enable option, using which memory.log would also should be generated

_Originally posted by @YarShev in https://github.com/modin-project/modin/issues/7092#issuecomment-2003894603_


Discussion:
Reopening as enable_api_only was deprecated and should be removed in a future release.

Resolving patch:
diff --git a/modin/config/envvars.py b/modin/config/envvars.py
--- a/modin/config/envvars.py
+++ b/modin/config/envvars.py
@@ -501,7 +501,7 @@ class LogMode(EnvironmentVariable, type=ExactStr):
     """Set ``LogMode`` value if users want to opt-in."""
 
     varname = "MODIN_LOG_MODE"
-    choices = ("enable", "disable", "enable_api_only")
+    choices = ("enable", "disable")
     default = "disable"
 
     @classmethod
@@ -514,15 +514,6 @@ def disable(cls) -> None:
         """Disable logging feature."""
         cls.put("disable")
 
-    @classmethod
-    def enable_api_only(cls) -> None:
-        """Enable API level logging."""
-        warnings.warn(
-            "'enable_api_only' value for LogMode is deprecated and"
-            + "will be removed in a future version."
-        )
-        cls.put("enable_api_only")
-
 
 class LogMemoryInterval(EnvironmentVariable, type=int):
     """Interval (in seconds) to profile memory utilization for logging."""
diff --git a/modin/logging/config.py b/modin/logging/config.py
--- a/modin/logging/config.py
+++ b/modin/logging/config.py
@@ -169,7 +169,7 @@ def configure_logging() -> None:
         "modin.logger.default",
         job_id,
         "trace",
-        LogLevel.INFO if LogMode.get() == "enable_api_only" else LogLevel.DEBUG,
+        LogLevel.INFO,
     )
 
     logger.info(f"OS Version: {platform.platform()}")
@@ -181,20 +181,17 @@ def configure_logging() -> None:
     logger.info(f"Physical Cores: {num_physical_cores}")
     logger.info(f"Total Cores: {num_total_cores}")
 
-    if LogMode.get() != "enable_api_only":
-        mem_sleep = LogMemoryInterval.get()
-        mem_logger = _create_logger(
-            "modin_memory.logger", job_id, "memory", LogLevel.DEBUG
-        )
+    mem_sleep = LogMemoryInterval.get()
+    mem_logger = _create_logger("modin_memory.logger", job_id, "memory", LogLevel.DEBUG)
 
-        svmem = psutil.virtual_memory()
-        mem_logger.info(f"Memory Total: {bytes_int_to_str(svmem.total)}")
-        mem_logger.info(f"Memory Available: {bytes_int_to_str(svmem.available)}")
-        mem_logger.info(f"Memory Used: {bytes_int_to_str(svmem.used)}")
-        mem = threading.Thread(
-            target=memory_thread, args=[mem_logger, mem_sleep], daemon=True
-        )
-        mem.start()
+    svmem = psutil.virtual_memory()
+    mem_logger.info(f"Memory Total: {bytes_int_to_str(svmem.total)}")
+    mem_logger.info(f"Memory Available: {bytes_int_to_str(svmem.available)}")
+    mem_logger.info(f"Memory Used: {bytes_int_to_str(svmem.used)}")
+    mem = threading.Thread(
+        target=memory_thread, args=[mem_logger, mem_sleep], daemon=True
+    )
+    mem.start()
 
     _create_logger("modin.logger.errors", job_id, "error", LogLevel.INFO)
 


Test patch: