-
-
Notifications
You must be signed in to change notification settings - Fork 276
Call options.log for structured logs
#3187
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 3 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
4fb4c8e
dbug log for structured logs
denrase 76dd002
add cl entry
denrase b3ca1c1
fix attr logging formatting
denrase 82ba562
Merge branch 'main' into feat/stuctured-logs-debug-log
denrase be37e32
use hub.options.log
denrase 2ca6150
revert SentryLogLevel changes
denrase d3ee8dd
remove unneeded code
denrase 4d3adc1
remove not needed ordinal
denrase 0f64f4f
remove comments
denrase aa0d470
Merge branch 'main' into feat/stuctured-logs-debug-log
denrase 08ee5a7
update double formatting
denrase 493cd3e
handle edge cases
denrase 25502a9
try setting negateive min value
denrase b97ca35
Merge branch 'main' into feat/stuctured-logs-debug-log
denrase 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
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
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,52 @@ | ||
| import 'package:test/test.dart'; | ||
| import 'package:sentry/src/protocol/sentry_log_level.dart'; | ||
| import 'package:sentry/src/protocol/sentry_level.dart'; | ||
|
|
||
| void main() { | ||
| group('SentryLogLevel', () { | ||
| test('fromName returns correct levels', () { | ||
| expect(SentryLogLevel.fromName('trace'), SentryLogLevel.trace); | ||
| expect(SentryLogLevel.fromName('debug'), SentryLogLevel.debug); | ||
| expect(SentryLogLevel.fromName('info'), SentryLogLevel.info); | ||
| expect(SentryLogLevel.fromName('warn'), SentryLogLevel.warn); | ||
| expect(SentryLogLevel.fromName('error'), SentryLogLevel.error); | ||
| expect(SentryLogLevel.fromName('fatal'), SentryLogLevel.fatal); | ||
| expect(SentryLogLevel.fromName('unknown'), SentryLogLevel.debug); | ||
| }); | ||
|
|
||
| test('toSeverityNumber returns correct values', () { | ||
| expect(SentryLogLevel.trace.toSeverityNumber(), 1); | ||
| expect(SentryLogLevel.debug.toSeverityNumber(), 5); | ||
| expect(SentryLogLevel.info.toSeverityNumber(), 9); | ||
| expect(SentryLogLevel.warn.toSeverityNumber(), 13); | ||
| expect(SentryLogLevel.error.toSeverityNumber(), 17); | ||
| expect(SentryLogLevel.fatal.toSeverityNumber(), 21); | ||
| }); | ||
|
|
||
| test('properties are correct', () { | ||
| expect(SentryLogLevel.trace.name, 'trace'); | ||
| expect(SentryLogLevel.trace.ordinal, 1); | ||
| expect(SentryLogLevel.debug.name, 'debug'); | ||
| expect(SentryLogLevel.debug.ordinal, 5); | ||
| expect(SentryLogLevel.info.name, 'info'); | ||
| expect(SentryLogLevel.info.ordinal, 9); | ||
| expect(SentryLogLevel.warn.name, 'warn'); | ||
| expect(SentryLogLevel.warn.ordinal, 13); | ||
| expect(SentryLogLevel.error.name, 'error'); | ||
| expect(SentryLogLevel.error.ordinal, 17); | ||
| expect(SentryLogLevel.fatal.name, 'fatal'); | ||
| expect(SentryLogLevel.fatal.ordinal, 21); | ||
| }); | ||
| }); | ||
|
|
||
| group('SentryLogLevelExtension', () { | ||
| test('toSentryLevel bridges levels correctly', () { | ||
| expect(SentryLogLevel.trace.toSentryLevel(), SentryLevel.debug); | ||
| expect(SentryLogLevel.debug.toSentryLevel(), SentryLevel.debug); | ||
| expect(SentryLogLevel.info.toSentryLevel(), SentryLevel.info); | ||
| expect(SentryLogLevel.warn.toSentryLevel(), SentryLevel.warning); | ||
| expect(SentryLogLevel.error.toSentryLevel(), SentryLevel.error); | ||
| expect(SentryLogLevel.fatal.toSentryLevel(), SentryLevel.fatal); | ||
| }); | ||
| }); | ||
| } |
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.