|
31 | 31 |
|
32 | 32 | from __future__ import absolute_import
|
33 | 33 |
|
34 |
| -import logging |
35 |
| -import warnings |
36 |
| - |
37 | 34 | import flask
|
38 | 35 | from flask import request, signals
|
39 | 36 |
|
40 | 37 | import elasticapm
|
41 | 38 | import elasticapm.instrumentation.control
|
42 | 39 | from elasticapm import get_client
|
43 | 40 | from elasticapm.base import Client
|
44 |
| -from elasticapm.conf import constants, setup_logging |
| 41 | +from elasticapm.conf import constants |
45 | 42 | from elasticapm.contrib.flask.utils import get_data_from_request, get_data_from_response
|
46 |
| -from elasticapm.handlers.logging import LoggingHandler |
47 | 43 | from elasticapm.traces import execution_context
|
48 | 44 | from elasticapm.utils import build_name_with_http_method_prefix
|
49 | 45 | from elasticapm.utils.disttracing import TraceParent
|
@@ -81,14 +77,8 @@ class ElasticAPM(object):
|
81 | 77 | >>> elasticapm.capture_message('hello, world!')
|
82 | 78 | """
|
83 | 79 |
|
84 |
| - def __init__(self, app=None, client=None, client_cls=Client, logging=False, **defaults) -> None: |
| 80 | + def __init__(self, app=None, client=None, client_cls=Client, **defaults) -> None: |
85 | 81 | self.app = app
|
86 |
| - self.logging = logging |
87 |
| - if self.logging: |
88 |
| - warnings.warn( |
89 |
| - "Flask log shipping is deprecated. See the Flask docs for more info and alternatives.", |
90 |
| - DeprecationWarning, |
91 |
| - ) |
92 | 82 | self.client = client or get_client()
|
93 | 83 | self.client_cls = client_cls
|
94 | 84 |
|
@@ -127,14 +117,6 @@ def init_app(self, app, **defaults) -> None:
|
127 | 117 |
|
128 | 118 | self.client = self.client_cls(config, **defaults)
|
129 | 119 |
|
130 |
| - # 0 is a valid log level (NOTSET), so we need to check explicitly for it |
131 |
| - if self.logging or self.logging is logging.NOTSET: |
132 |
| - if self.logging is not True: |
133 |
| - kwargs = {"level": self.logging} |
134 |
| - else: |
135 |
| - kwargs = {} |
136 |
| - setup_logging(LoggingHandler(self.client, **kwargs)) |
137 |
| - |
138 | 120 | signals.got_request_exception.connect(self.handle_exception, sender=app, weak=False)
|
139 | 121 |
|
140 | 122 | try:
|
|
0 commit comments