-
Notifications
You must be signed in to change notification settings - Fork 643
feat(logs): Add alpha version of Sentry logs #4126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
4a34301
feat(ourlogs): Add alpha version of logger
colin-sentry a94de84
circular import, etc
colin-sentry aa54b5c
camel the item
colin-sentry 26a1fe4
mypy
colin-sentry ba7db76
mypy
colin-sentry 0da4340
move to experimental
colin-sentry e8a1c08
mypy
colin-sentry 24ae29a
mypy
colin-sentry 41d39e9
mypu
colin-sentry bef8fff
rename before_send_log, handle parent_span_id
colin-sentry e2d39f0
whitespace
antonpirker d1fce6c
Added some basic unit tests
antonpirker 5891202
explainational text
antonpirker bad1974
the last assert
antonpirker 92b7e6d
Logs tied to transactions/spans
antonpirker 176f45e
Added todos
antonpirker 42f1fb8
Fixed boolValue
antonpirker 1be2ce3
typo
antonpirker 688c77e
typo
antonpirker dfa1618
Merge branch 'master' into logging_integration
antonpirker 017251e
Merge branch 'master' into logging_integration
antonpirker 88a7780
renamed file
antonpirker d90a2da
Mark capture_log as private
antonpirker cccce0f
Move config params into _experimental
antonpirker 7472d5f
Cleaned up tests
antonpirker 712eb5b
Format tests
antonpirker e8168fe
Linting
antonpirker 4dd9854
Merge branch 'master' into logging_integration
antonpirker 194b939
If debug is enabled, also print logs to console
antonpirker 96b3a13
Skip the tests below Python 3.7
antonpirker 1906ab4
pytest skipping tests
antonpirker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # NOTE: this is the logger sentry exposes to users, not some generic logger. | ||
| import functools | ||
| from typing import Any | ||
|
|
||
| from sentry_sdk import get_client, get_current_scope | ||
|
|
||
|
|
||
| def _capture_log(severity_text, severity_number, template, **kwargs): | ||
| # type: (str, int, str, **Any) -> None | ||
| client = get_client() | ||
| scope = get_current_scope() | ||
| client.capture_log(scope, severity_text, severity_number, template, **kwargs) | ||
|
|
||
|
|
||
| trace = functools.partial(_capture_log, "trace", 1) | ||
| debug = functools.partial(_capture_log, "debug", 5) | ||
| info = functools.partial(_capture_log, "info", 9) | ||
| warn = functools.partial(_capture_log, "warn", 13) | ||
| error = functools.partial(_capture_log, "error", 17) | ||
| fatal = functools.partial(_capture_log, "fatal", 21) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.