appier 1.34.7__py2.py3-none-any.whl → 1.34.8__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- appier/api.py +10 -0
- appier/asgi.py +10 -0
- appier/base.py +11 -1
- appier/bus.py +10 -0
- appier/config.py +409 -401
- appier/exceptions.py +450 -442
- appier/http.py +1292 -1283
- appier/mongo.py +24 -0
- appier/scheduler.py +342 -334
- appier/test/error_handler.py +17 -11
- appier/test/exception_handler.py +44 -41
- appier/test/tags.py +109 -0
- appier/util.py +2517 -2508
- {appier-1.34.7.dist-info → appier-1.34.8.dist-info}/METADATA +1 -1
- {appier-1.34.7.dist-info → appier-1.34.8.dist-info}/RECORD +18 -17
- {appier-1.34.7.dist-info → appier-1.34.8.dist-info}/LICENSE +0 -0
- {appier-1.34.7.dist-info → appier-1.34.8.dist-info}/WHEEL +0 -0
- {appier-1.34.7.dist-info → appier-1.34.8.dist-info}/top_level.txt +0 -0
appier/mongo.py
CHANGED
|
@@ -29,6 +29,7 @@ __license__ = "Apache License, Version 2.0"
|
|
|
29
29
|
""" The license for the module """
|
|
30
30
|
|
|
31
31
|
import json
|
|
32
|
+
import logging
|
|
32
33
|
|
|
33
34
|
from . import util
|
|
34
35
|
from . import legacy
|
|
@@ -385,3 +386,26 @@ def _motor(verify=True):
|
|
|
385
386
|
exception=exceptions.OperationalError,
|
|
386
387
|
)
|
|
387
388
|
return motor.motor_asyncio
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
def _patch_logging():
|
|
392
|
+
"""
|
|
393
|
+
Patch the logging settings for the pymongo library, so
|
|
394
|
+
that it does not interfere with the application's logging.
|
|
395
|
+
"""
|
|
396
|
+
|
|
397
|
+
pymongo_logger = logging.getLogger("pymongo")
|
|
398
|
+
pymongo_logger.propagate = False
|
|
399
|
+
pymongo_logger.setLevel(logging.INFO)
|
|
400
|
+
|
|
401
|
+
handler = logging.StreamHandler()
|
|
402
|
+
formatter = logging.Formatter("%(asctime)s [%(levelname)s] [%(name)s] %(message)s")
|
|
403
|
+
handler.setFormatter(formatter)
|
|
404
|
+
|
|
405
|
+
for handler in pymongo_logger.handlers:
|
|
406
|
+
pymongo_logger.removeHandler(handler)
|
|
407
|
+
|
|
408
|
+
pymongo_logger.addHandler(handler)
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
_patch_logging()
|