HyukjinKwon commented on code in PR #39212:
URL: https://github.com/apache/spark/pull/39212#discussion_r1057464481


##########
python/pyspark/sql/connect/client.py:
##########
@@ -36,6 +41,49 @@
 )
 
 
+def _configure_logging() -> logging.Logger:
+    """Configure logging for the Spark Connect clients."""
+    logger = logging.getLogger("pyspark.sql.connect.client")
+    handler = logging.StreamHandler()
+    handler.setFormatter(
+        logging.Formatter(fmt="%(asctime)s %(process)d %(levelname)s 
%(funcName)s %(message)s")
+    )
+    logger.addHandler(handler)
+
+    # Check the environment variables for log levels:
+    level = os.getenv("SPARK_CONNECT_LOG_LEVEL", "none").lower()

Review Comment:
   No biggie but we could do this like:
   
   ```python
   if "SPARK_CONNECT_LOG_LEVEL" os.environ:
       logger.setLevel(os.getenv("SPARK_CONNECT_LOG_LEVEL").upper())
   else:
       logger.disabled = True
   ```
   
   so it throws an exception if a weird value is set.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to