Skip to content

feat: add event_log_level config to control per-event logging - #80

Merged
fangzheng merged 1 commit into
mainfrom
event-log-level
Oct 15, 2026
Merged

fangzheng merged 1 commit into
mainfrom
event-log-level

Conversation

@fangzheng

@fangzheng fangzheng commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

ResponseProcessor.log() always logs every sent or dropped event at INFO level, which can be noisy for high-volume services. This adds a Config option so the caller decides how those per-event logs are emitted:

from amplitude import Amplitude, Config, EventLogLevel

client = Amplitude("API_KEY", Config(event_log_level=EventLogLevel.DEBUG))  # or NONE / INFO
  • New EventLogLevel enum (NONE, DEBUG, INFO) in amplitude.constants, exported from amplitude.
  • New Config.event_log_level, default EventLogLevel.INFO (keeps current behavior).
  • ResponseProcessor.log() skips logging for NONE and uses logger.debug / logger.info otherwise. Applies to every log() call (success, invalid, payload-too-large, storage-full, unknown errors).
  • logger.exception for failing user callbacks is unchanged.
  • Unit tests for each level; full suite passes (118 tests).

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?: No

🤖 Generated with Claude Code


Note

Low Risk
Observability-only change with backward-compatible default; no changes to event delivery, callbacks, or retry logic.

Overview
Adds event_log_level on Config so callers can tune how per-event send/drop logs are emitted instead of always using INFO.

Introduces EventLogLevel (NONE, DEBUG, INFO), exported from the package, with default INFO so existing behavior is unchanged. ResponseProcessor.log() now skips logging when set to NONE, uses logger.debug for DEBUG, and logger.info otherwise for all paths that call log() (success, validation failures, storage full, etc.). User callback logger.exception behavior is untouched.

Unit tests cover default INFO, DEBUG, and disabled logging on successful sends.

Reviewed by Cursor Bugbot for commit 1221ffa. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@daniel-graham-amplitude

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T20:36:18.613528Z 1221ffa Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 1221ffab9f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@daniel-graham-amplitude daniel-graham-amplitude left a comment

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.

Lgtm, thanks!

@fangzheng
fangzheng merged commit 138a77a into main Oct 15, 2026
13 checks passed
@fangzheng
fangzheng deleted the event-log-level branch October 15, 2026 20:45
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