Parcourir la source

Add warn method on logger (synonym for warning)

Gunnlaugur Thor Briem il y a 15 ans
Parent
commit
bb8cc4abfe
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4 0
      celery/utils/compat.py

+ 4 - 0
celery/utils/compat.py

@@ -316,6 +316,10 @@ except ImportError:
             msg, kwargs = self.process(msg, kwargs)
             self.logger.warning(msg, *args, **kwargs)
 
+        def warn(self, msg, *args, **kwargs):
+            msg, kwargs = self.process(msg, kwargs)
+            self.logger.warn(msg, *args, **kwargs)
+
         def error(self, msg, *args, **kwargs):
             msg, kwargs = self.process(msg, kwargs)
             self.logger.error(msg, *args, **kwargs)