eschutho commented on code in PR #25118:
URL: https://github.com/apache/superset/pull/25118#discussion_r1309454843


##########
superset/stats_logger.py:
##########
@@ -51,24 +63,30 @@ def gauge(self, key: str, value: float) -> None:
 
 class DummyStatsLogger(BaseStatsLogger):
     def incr(self, key: str) -> None:
-        logger.debug(Fore.CYAN + "[stats_logger] (incr) " + key + 
Style.RESET_ALL)
+        if self.should_log(key):
+            logger.debug(Fore.CYAN + "[stats_logger] (incr) " + key + 
Style.RESET_ALL)
 
     def decr(self, key: str) -> None:
-        logger.debug(Fore.CYAN + "[stats_logger] (decr) " + key + 
Style.RESET_ALL)
+        if self.should_log(key):
+            logger.debug(Fore.CYAN + "[stats_logger] (decr) " + key + 
Style.RESET_ALL)
 
     def timing(self, key: str, value: float) -> None:
-        logger.debug(
-            Fore.CYAN + f"[stats_logger] (timing) {key} | {value} " + 
Style.RESET_ALL
-        )
+        if self.should_log(key):
+            logger.debug(
+                Fore.CYAN
+                + f"[stats_logger] (timing) {key} | {value} "
+                + Style.RESET_ALL
+            )
 
     def gauge(self, key: str, value: float) -> None:
-        logger.debug(
-            Fore.CYAN
-            + "[stats_logger] (gauge) "
-            + f"{key}"
-            + f"{value}"
-            + Style.RESET_ALL
-        )
+        if self.should_log(key):

Review Comment:
   @villebro so anyone who wants to use this denylist is going to have to 
implement the functionality in their own statslogger if they don't use the 
dummy. Should we put something in UPDATING to explain how to do this or do you 
think it's evident enough when reading this local example?



-- 
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