Skip to content

Commit 9491b4e

Browse files
committed
log_decorator
1 parent cefce58 commit 9491b4e

File tree

4 files changed

+3
-372
lines changed

4 files changed

+3
-372
lines changed

lambdas/filenameprocessor/src/file_name_processor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
from uuid import uuid4
1111

1212
from audit_table import upsert_audit_table
13-
from common.clients import logger, s3_client
13+
from common.clients import STREAM_NAME, logger, s3_client
14+
from common.log_decorator import logging_decorator
1415
from common.models.errors import (
1516
InvalidFileKeyError,
1617
UnhandledAuditTableError,
@@ -24,7 +25,6 @@
2425
FileStatus,
2526
)
2627
from file_validation import is_file_in_directory_root, validate_file_key
27-
from logging_decorator import logging_decorator
2828
from make_and_upload_ack_file import make_and_upload_the_ack_file
2929
from send_sqs_message import make_and_send_sqs_message
3030
from supplier_permissions import validate_vaccine_type_permissions
@@ -34,7 +34,7 @@
3434
# NOTE: logging_decorator is applied to handle_record function, rather than lambda_handler, because
3535
# the logging_decorator is for an individual record, whereas the lambda_handler could potentially be handling
3636
# multiple records.
37-
@logging_decorator
37+
@logging_decorator(prefix="filename_processor", stream_name=STREAM_NAME)
3838
def handle_record(record) -> dict:
3939
"""
4040
Processes a single record based on whether it came from the 'data-sources' or 'config' bucket.

lambdas/filenameprocessor/src/logging_decorator.py

Lines changed: 0 additions & 86 deletions
This file was deleted.

lambdas/filenameprocessor/tests/test_lambda_handler.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,11 @@ def run(self, result=None):
9797
def setUp(self):
9898
GenericSetUp(s3_client, firehose_client, sqs_client, dynamodb_client)
9999
self.logger_patcher = patch("file_name_processor.logger")
100-
self.decorator_logger_patcher = patch("logging_decorator.logger")
101100
self.mock_logger = self.logger_patcher.start()
102-
self.mock_decorator_logger = self.decorator_logger_patcher.start()
103101

104102
def tearDown(self):
105103
GenericTearDown(s3_client, firehose_client, sqs_client, dynamodb_client)
106104
self.logger_patcher.stop()
107-
self.decorator_logger_patcher.stop()
108105

109106
@staticmethod
110107
def make_record(file_key: str):

0 commit comments

Comments
 (0)