Skip to content

Commit 18f49c2

Browse files
committed
Flush to logs from config.
1 parent 7287013 commit 18f49c2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

datadog_lambda/wrapper.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161

6262
logger = logging.getLogger(__name__)
6363

64-
DD_FLUSH_TO_LOG = "DD_FLUSH_TO_LOG"
6564
DD_LOGS_INJECTION = "DD_LOGS_INJECTION"
6665
DD_MERGE_XRAY_TRACES = "DD_MERGE_XRAY_TRACES"
6766
AWS_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME"
@@ -158,7 +157,6 @@ def __init__(self, func):
158157
"""Executes when the wrapped function gets wrapped"""
159158
try:
160159
self.func = func
161-
self.flush_to_log = os.environ.get(DD_FLUSH_TO_LOG, "").lower() == "true"
162160
self.logs_injection = (
163161
os.environ.get(DD_LOGS_INJECTION, "true").lower() == "true"
164162
)
@@ -392,7 +390,7 @@ def _after(self, event, context):
392390
except Exception as e:
393391
logger.debug("Failed to create cold start spans. %s", e)
394392

395-
if not self.flush_to_log or should_use_extension:
393+
if not config.flush_to_log or should_use_extension:
396394
from datadog_lambda.metric import flush_stats
397395

398396
flush_stats(context)

0 commit comments

Comments
 (0)