Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors logging behavior across the application by changing log levels from info to debug for various operational messages and improving error message clarity. The changes also update version numbers and default logging configuration.
- Changed default logging level from INFO to WARNING to reduce verbose output
- Converted several info-level logs to debug-level for operational details
- Improved clarity of error messages throughout the codebase
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.py | New setup configuration file with version 1.0.2-1 |
| pyproject.toml | Updated version to 1.0.2-1 |
| main/scripts/get.py | Changed execution and client logs to debug level, improved warning message |
| main/data/client.py | Enhanced error message to include PV name context |
| main/contrib/data.py | Converted info logs to debug and improved warning message clarity |
| main/init.py | Changed default log level from INFO to WARNING and updated version |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
main/contrib/data.py
Outdated
| data.rename(columns={'val': pv}, inplace=True) | ||
| r = data | ||
| _LOGGER.warning(f"Only got a single sample for '{pv}'") | ||
| _LOGGER.warning(f"Only one sample got for '{pv}'") |
There was a problem hiding this comment.
The grammar is incorrect. Should be 'Only one sample was retrieved for' or 'Got only one sample for' instead of 'Only one sample got for'.
| _LOGGER.warning(f"Only one sample got for '{pv}'") | |
| _LOGGER.warning(f"Only one sample was retrieved for '{pv}'") |
| data.dropna(inplace=True) | ||
| if verbose > 0: | ||
| _LOGGER.info(f"Fetched all data in {time.time() - t0_:.1f} seconds") | ||
| _LOGGER.debug(f"Fetched all data in {time.time() - t0_:.1f} seconds") |
There was a problem hiding this comment.
This debug log is now always executed regardless of verbose level, but the original code only logged this when verbose > 0. Consider adding the verbose check back if this timing information should only be shown when explicitly requested.
| _LOGGER.debug(f"Fetched all data in {time.time() - t0_:.1f} seconds") | |
| if verbose > 0: | |
| _LOGGER.debug(f"Fetched all data in {time.time() - t0_:.1f} seconds") |
No description provided.