Conversation
|
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 4 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 91e8e07. Configure here.
| """ | ||
|
|
||
| def __init__(self, mezmo_key: str = "Keep", app: str = "Keep", env: str = "production", hostname: str = "keep-server"): | ||
| self.mezmo_key = MEZMO_INGESTION_KEY |
There was a problem hiding this comment.
Undefined variable MEZMO_INGESTION_KEY causes NameError on instantiation
High Severity
self.mezmo_key = MEZMO_INGESTION_KEY references a variable that only exists inside the if __name__ == "__main__": block, so it's undefined at module scope. Any normal instantiation of MezmoProvider (e.g. when imported by the provider framework) will raise a NameError. The mezmo_key constructor parameter is accepted but never used, compounding the issue.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 91e8e07. Configure here.
| } | ||
| logging_config["loggers"]["keep"]["handlers"].append("mezmo") | ||
| except ImportError: | ||
| logging.warning("logdna package not installed") |
There was a problem hiding this comment.
try/except ImportError can never catch dictionary construction
Medium Severity
The try/except ImportError wraps pure dictionary construction, which can never raise an ImportError. The actual import of logdna.LogDNAHandler happens later inside logging.config.dictConfig() in _setup_logger, which is outside this handler. If logdna is missing, the error will propagate unhandled instead of falling back to console logging as intended.
Reviewed by Cursor Bugbot for commit 91e8e07. Configure here.
| logger.info("Hello from Keep!") | ||
| """ | ||
|
|
||
| def __init__(self, mezmo_key: str = "Keep", app: str = "Keep", env: str = "production", hostname: str = "keep-server"): |
There was a problem hiding this comment.
Default mezmo_key parameter value is "Keep" not None
Low Severity
The mezmo_key parameter defaults to "Keep", which appears to be a copy-paste error from the app parameter. This would always be truthy, defeating the fallback-to-console behavior described in the PR. The default likely needs to be None so the if self.mezmo_key: check in _build_config can correctly skip the Mezmo handler when no key is provided.
Reviewed by Cursor Bugbot for commit 91e8e07. Configure here.
| if not MEZMO_INGESTION_KEY: | ||
| raise ValueError("Mezmo ingestion key is empty!") | ||
| except NameError: | ||
| raise ValueError("MEZMO_INGESTION_KEY is not defined!") |
There was a problem hiding this comment.
Unreachable except NameError due to prior assignment
Low Severity
The except NameError handler on lines 94–95 is unreachable dead code. MEZMO_INGESTION_KEY is unconditionally assigned on line 88 via os.environ.get(...), so it will always be defined (as None or a string) by the time the try block on line 91 executes. A NameError can never occur here, making the fallback error message misleading and the branch dead.
Reviewed by Cursor Bugbot for commit 91e8e07. Configure here.
|
You have used all of your free Bugbot PR reviews. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
|
Thanks for the review! I've addressed all the reported issues:
Please let me know if any further changes are needed 🙂 |
|
You have used all of your free Bugbot PR reviews. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |


Closes #1838
📑 Description
This PR adds support for a Mezmo (LogDNA) logging provider.
Changes:
MEZMO_INGESTION_KEY✅ Checks
ℹ Additional Information
logdnapackage for Mezmo integrationMEZMO_INGESTION_KEYNote
Medium Risk
Introduces new logging initialization and an optional external
logdnahandler controlled by environment configuration, which can affect runtime logging behavior and startup if misconfigured or dependencies are missing.Overview
Adds a new
MezmoProviderunderkeep/providers/mezmo_providerto configure thekeeplogger vialogging.config.dictConfig, always logging to stdout and optionally adding a Mezmo/LogDNA handler whenMEZMO_INGESTION_KEYis present.Includes dotenv-based env loading plus a small
__main__validation path for missing/empty ingestion keys, with a fallback warning when thelogdnapackage isn’t installed.Reviewed by Cursor Bugbot for commit 91e8e07. Bugbot is set up for automated code reviews on this repo. Configure here.