Skip to content

Commit ab67bd4

Browse files
committed
Flush to logs from config.
1 parent b89acab commit ab67bd4

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

datadog_lambda/wrapper.py

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

6464
logger = logging.getLogger(__name__)
6565

66-
DD_FLUSH_TO_LOG = "DD_FLUSH_TO_LOG"
6766
DD_LOGS_INJECTION = "DD_LOGS_INJECTION"
6867
DD_MERGE_XRAY_TRACES = "DD_MERGE_XRAY_TRACES"
6968
AWS_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME"
@@ -161,7 +160,6 @@ def __init__(self, func):
161160
"""Executes when the wrapped function gets wrapped"""
162161
try:
163162
self.func = func
164-
self.flush_to_log = os.environ.get(DD_FLUSH_TO_LOG, "").lower() == "true"
165163
self.logs_injection = (
166164
os.environ.get(DD_LOGS_INJECTION, "true").lower() == "true"
167165
)
@@ -400,7 +398,7 @@ def _after(self, event, context):
400398
except Exception as e:
401399
logger.debug("Failed to create cold start spans. %s", e)
402400

403-
if not self.flush_to_log or should_use_extension:
401+
if not config.flush_to_log or should_use_extension:
404402
from datadog_lambda.metric import flush_stats
405403

406404
flush_stats(context)

0 commit comments

Comments
 (0)