Skip to content

feat!: exclude CSP violations from LogReport by default and log at warning level#12

Merged
audunru merged 1 commit intomainfrom
feat/log-report-exclude-csp
May 3, 2026
Merged

feat!: exclude CSP violations from LogReport by default and log at warning level#12
audunru merged 1 commit intomainfrom
feat/log-report-exclude-csp

Conversation

@audunru
Copy link
Copy Markdown
Owner

@audunru audunru commented May 3, 2026

Summary

  • LogReport now skips csp-violation reports by default — LogCspViolation already handles those with a more targeted log message, so registering both no longer causes double-logging
  • Log level changed from info to warning
  • Consumers who want the old behavior can subclass LogReport and override shouldExclude() to return false

Breaking changes

  • LogReport no longer logs CSP violations by default
  • Log level changed from info to warning

Test plan

  • Existing test_logs_info_for_any_report updated to assert warning level
  • New test_skips_csp_violations_by_default confirms CSP events are skipped
  • All 47 tests pass

Closes #11

🤖 Generated with Claude Code

…ning level

LogReport now skips csp-violation reports by default (since LogCspViolation
already handles them) and logs at warning level instead of info.

BREAKING CHANGE: LogReport no longer logs CSP violations by default, and log
level changed from info to warning. Override shouldExclude() returning false
to restore the previous CSP logging behavior.

Closes #11

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@audunru audunru merged commit 680e885 into main May 3, 2026
2 checks passed
@audunru audunru deleted the feat/log-report-exclude-csp branch May 3, 2026 08:37
audunru pushed a commit that referenced this pull request May 3, 2026
# [2.0.0](v1.2.2...v2.0.0) (2026-05-03)

### Features

* exclude CSP violations from LogReport by default and log at warning level ([#12](#12)) ([680e885](680e885)), closes [#11](#11)

### BREAKING CHANGES

* LogReport no longer logs CSP violations by default, and log
level changed from info to warning. Override shouldExclude() returning false
to restore the previous CSP logging behavior.
@audunru
Copy link
Copy Markdown
Owner Author

audunru commented May 3, 2026

🎉 This PR is included in version 2.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LogReport should exclude csp reports by default

1 participant