removed useless debug logging#1133
Conversation
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 4204158 | Triggered | Generic High Entropy Secret | 8add907 | examples/test_influx.py | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Reviewer's Guide by SourceryThis pull request focuses on removing unnecessary debug logging statements from various files in the asyncdb project. The changes are implemented by commenting out or deleting the debug log lines, which helps in cleaning up the code and potentially improving performance by reducing logging overhead. File-Level Changes
Tips
|
There was a problem hiding this comment.
Hey @phenobarbital - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 6 issues found
- 🟡 Security: 1 issue found
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
| Creates a Pool Connection. | ||
| """ | ||
| self._logger.debug(f"AsyncPg (Pool): Connecting to {self._dsn}") | ||
| # self._logger.debug(f"AsyncPg (Pool): Connecting to {self._dsn}") |
There was a problem hiding this comment.
suggestion: Commented out debug logging
The debug logging for the connection has been commented out. If this is intentional for production, consider adding a conditional debug flag to enable it when needed.
| # self._logger.debug(f"AsyncPg (Pool): Connecting to {self._dsn}") | |
| if self._debug: | |
| self._logger.debug(f"AsyncPg (Pool): Connecting to {self._dsn}") |
| except (ValueError, RuntimeError) as err: | ||
| self._logger.warning(f"Error on Init Connection: {err}") | ||
| self._initialized_on = time.time() | ||
| self._logger.debug(f"Initialized on: {self._initialized_on}") |
There was a problem hiding this comment.
suggestion: Removed debug logging for initialization
The debug logging for initialization has been removed. If this was useful for debugging purposes, consider adding a conditional debug flag to enable it when needed.
| self._logger.debug(f"Initialized on: {self._initialized_on}") | |
| except (ValueError, RuntimeError) as err: | |
| self._logger.warning(f"Error on Init Connection: {err}") | |
| self._initialized_on = time.time() | |
| if self._debug: | |
| self._logger.debug(f"Initialized on: {self._initialized_on}") | |
| return self | |
| except ConnectionRefusedError as err: |
| self._logger.debug( | ||
| f'RT Connection to host {self.params["host"]}:{self.params["port"]}' | ||
| ) |
There was a problem hiding this comment.
suggestion: Removed debug logging for RethinkDB connection
The debug logging for the RethinkDB connection has been removed. If this was useful for monitoring connections, consider adding a conditional debug flag to enable it when needed.
| self._logger.debug( | |
| f'RT Connection to host {self.params["host"]}:{self.params["port"]}' | |
| ) | |
| if self.params.get("debug", False): | |
| self._logger.debug( | |
| f'RT Connection to host {self.params["host"]}:{self.params["port"]}' | |
| ) |
| "user": "troc_pgdata", | ||
| "password": "12345678", | ||
| "org": "navigator", | ||
| "bucket": "navigator", |
There was a problem hiding this comment.
🚨 issue (security): Removed sensitive token
The token has been removed from the parameters. Ensure that this change does not affect the functionality of the test and that the token is securely managed elsewhere.
| return params | ||
|
|
||
| async def connect(self): | ||
| self._logger.debug(f"Memcache: Connecting to {self._params}") |
There was a problem hiding this comment.
suggestion: Removed debug logging for Memcache connection
The debug logging for the Memcache connection has been removed. If this was useful for debugging purposes, consider adding a conditional debug flag to enable it when needed.
| self._logger.debug(f"Memcache: Connecting to {self._params}") | |
| return params | |
| async def connect(self, debug=False): | |
| if debug: | |
| self._logger.debug(f"Memcache: Connecting to {self._params}") | |
| try: | |
| self._pool = aiomcache.Client(pool_size=self._max_queries, **self._params) |
| execution_profiles=profiles, | ||
| **params, | ||
| ) | ||
| print(self._cluster) |
There was a problem hiding this comment.
suggestion: Removed print statement
The print statement for the cluster has been removed. Ensure that this information is logged appropriately if needed for debugging or monitoring.
| print(self._cluster) | |
| import logging | |
| logger = logging.getLogger(__name__) | |
| logger.debug(f"Cluster: {self._cluster}") |
| """ | ||
| __init async db initialization | ||
| """ | ||
| self._logger.debug(f"Redis Pool: Connecting to {self._dsn}") |
There was a problem hiding this comment.
suggestion: Removed debug logging for Redis connection
The debug logging for the Redis connection has been removed. If this was useful for debugging purposes, consider adding a conditional debug flag to enable it when needed.
| self._logger.debug(f"Redis Pool: Connecting to {self._dsn}") | |
| if self._debug: | |
| self._logger.debug(f"Redis Pool: Connecting to {self._dsn}") |
removed useless debug logging
Summary by Sourcery
This pull request removes unnecessary debug logging statements from various driver files, including PostgreSQL, RethinkDB, Memcache, Cassandra, and Redis. Additionally, it updates the version number of the asyncdb library from 2.7.10 to 2.7.11.