Repository: modin-project/modin

Issue:
Fix Modin Logging to report specific errors instead of error API calls
### Describe the problem

Modin Logging reports several lines like:

> 88001, 4538414592, 2022-05-26,16:44:07.377470, START::MODIN-ERROR::ErrorMessage.catch_bugs_and_request_email
> 88001, 4538414592, 2022-05-26,16:44:07.377538, STOP::MODIN-ERROR::ErrorMessage.catch_bugs_and_request_email 

We want to only report the specific errors and not the API calls to these functions that do not raise the actual exceptions.

### Source code / logs
<!-- Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem. -->



Discussion:

Resolving patch:
diff --git a/modin/error_message.py b/modin/error_message.py
--- a/modin/error_message.py
+++ b/modin/error_message.py
@@ -12,7 +12,7 @@
 # governing permissions and limitations under the License.
 
 import warnings
-from modin.logging import logger_decorator
+from modin.logging import get_logger
 
 
 class ErrorMessage(object):
@@ -21,10 +21,10 @@ class ErrorMessage(object):
     printed_warnings = set()
 
     @classmethod
-    @logger_decorator("MODIN-ERROR", "ErrorMessage.not_implemented", "debug")
     def not_implemented(cls, message=""):
         if message == "":
             message = "This functionality is not yet available in Modin."
+        get_logger().info(f"Modin Error: NotImplementedError: {message}")
         raise NotImplementedError(
             f"{message}\n"
             + "To request implementation, file an issue at "
@@ -33,17 +33,20 @@ def not_implemented(cls, message=""):
         )
 
     @classmethod
-    @logger_decorator("MODIN-ERROR", "ErrorMessage.single_warning", "debug")
     def single_warning(cls, message):
         message_hash = hash(message)
+        logger = get_logger()
         if message_hash in cls.printed_warnings:
+            logger.debug(
+                f"Modin Warning: Single Warning: {message} was raised and suppressed."
+            )
             return
 
+        logger.debug(f"Modin Warning: Single Warning: {message} was raised.")
         warnings.warn(message)
         cls.printed_warnings.add(message_hash)
 
     @classmethod
-    @logger_decorator("MODIN-ERROR", "ErrorMessage.default_to_pandas", "debug")
     def default_to_pandas(cls, message=""):
         if message != "":
             message = f"{message} defaulting to pandas implementation."
@@ -57,14 +60,13 @@ def default_to_pandas(cls, message=""):
                 + "https://modin.readthedocs.io/en/stable/supported_apis/defaulting_to_pandas.html for explanation."
             )
             cls.printed_default_to_pandas = True
+        get_logger().debug(f"Modin Warning: Default to pandas: {message}")
         warnings.warn(message)
 
     @classmethod
-    @logger_decorator(
-        "MODIN-ERROR", "ErrorMessage.catch_bugs_and_request_email", "debug"
-    )
     def catch_bugs_and_request_email(cls, failure_condition, extra_log=""):
         if failure_condition:
+            get_logger().info(f"Modin Error: Internal Error: {extra_log}")
             raise Exception(
                 "Internal Error. "
                 + "Please visit https://github.com/modin-project/modin/issues "
@@ -74,23 +76,25 @@ def catch_bugs_and_request_email(cls, failure_condition, extra_log=""):
             )
 
     @classmethod
-    @logger_decorator("MODIN-ERROR", "ErrorMessage.non_verified_udf", "debug")
     def non_verified_udf(cls):
+        get_logger().debug("Modin Warning: Non Verified UDF")
         warnings.warn(
             "User-defined function verification is still under development in Modin. "
             + "The function provided is not verified."
         )
 
     @classmethod
-    @logger_decorator("MODIN-ERROR", "ErrorMessage.mismatch_with_pandas", "debug")
     def missmatch_with_pandas(cls, operation, message):
+        get_logger().debug(
+            f"Modin Warning: {operation} mismatch with pandas: {message}"
+        )
         cls.single_warning(
             f"`{operation}` implementation has mismatches with pandas:\n{message}."
         )
 
     @classmethod
-    @logger_decorator("MODIN-ERROR", "ErrorMessage.not_initialized", "debug")
     def not_initialized(cls, engine, code):
+        get_logger().debug(f"Modin Warning: Not Initialized: {engine}")
         warnings.warn(
             f"{engine} execution environment not yet initialized. Initializing...\n"
             + "To remove this warning, run the following python code before doing dataframe operations:\n"


Test patch: