Skip to content

Prevent function crash when setting unknown log level.#418

Merged
purple4reina merged 1 commit intomainfrom
rey.abolofia/loglevels
Feb 14, 2024
Merged

Prevent function crash when setting unknown log level.#418
purple4reina merged 1 commit intomainfrom
rey.abolofia/loglevels

Conversation

@purple4reina
Copy link
Copy Markdown
Contributor

What does this PR do?

Prevents function crash when setting DD_LOG_LEVEL to an unknown value. Also increases the number of available default log levels.

Motivation

#417

Testing Guidelines

Additional Notes

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)

@purple4reina purple4reina requested a review from a team as a code owner February 14, 2024 18:27
Comment thread datadog_lambda/logger.py Outdated
@purple4reina purple4reina force-pushed the rey.abolofia/loglevels branch from a5077e5 to 4e5d3e5 Compare February 14, 2024 18:37
@purple4reina purple4reina force-pushed the rey.abolofia/loglevels branch 2 times, most recently from 85e5f50 to b9e7f05 Compare February 14, 2024 18:55
@purple4reina purple4reina force-pushed the rey.abolofia/loglevels branch from b9e7f05 to 16d2bde Compare February 14, 2024 18:57
Comment thread tests/test_logger.py

from datadog_lambda.logger import initialize_logging

_test_initialize_logging = (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great parameterizing!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in python, it's spelled parametrizing, whoever wrote it forgot the second e 😆

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder which one is the english version and which is the american one lol

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to wikipedia I guess both spells are correct? And that they're all british? https://en.wiktionary.org/wiki/parametrize

Copy link
Copy Markdown
Contributor

@duncanista duncanista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@purple4reina purple4reina merged commit 17c8e0b into main Feb 14, 2024
@purple4reina purple4reina deleted the rey.abolofia/loglevels branch February 14, 2024 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants