Skip to content

Commit

Permalink
Rename logging function
Browse files Browse the repository at this point in the history
  • Loading branch information
skupriienko committed Nov 22, 2024
1 parent 88f8b69 commit 09d153c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mailjet_rest/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ def build_url(
return url


def logger_handler(
def logging_handler(
to_file: bool = False,
) -> logging.Logger:
"""Create and configure a logger for logging API requests.
Expand Down
8 changes: 4 additions & 4 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from mailjet_rest.utils.version import get_version
from mailjet_rest import Client
from mailjet_rest.client import prepare_url, parse_response, logger_handler, Config
from mailjet_rest.client import prepare_url, parse_response, logging_handler, Config


def validate_datetime_format(date_text: str, datetime_format: str) -> None:
Expand Down Expand Up @@ -446,7 +446,7 @@ def test_debug_logging_to_stdout_has_all_debug_entries(
caplog (LogCaptureFixture): A fixture for capturing log entries.
"""
result = client_mj30.contact.get()
parse_response(result, lambda: logger_handler(to_file=False), debug=True)
parse_response(result, lambda: logging_handler(to_file=False), debug=True)
debug_entries = [
"DEBUG",
"REQUEST:",
Expand All @@ -473,8 +473,8 @@ def test_debug_logging_to_log_file(
caplog (LogCaptureFixture): A fixture for capturing log entries.
"""
result = client_mj30.contact.get()
parse_response(result, logger_handler, debug=True)
partial(logger_handler, to_file=True)
parse_response(result, logging_handler, debug=True)
partial(logging_handler, to_file=True)
cwd = Path.cwd()
log_files = glob.glob("*.log")
for log_file in log_files:
Expand Down

0 comments on commit 09d153c

Please sign in to comment.