Skip to content

Refactor logs#19

Merged
zhangt58 merged 6 commits intomasterfrom
log
Sep 19, 2025
Merged

Refactor logs#19
zhangt58 merged 6 commits intomasterfrom
log

Conversation

@zhangt58
Copy link
Owner

No description provided.

@zhangt58 zhangt58 requested a review from Copilot September 19, 2025 14:31
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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}'")
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'.

Suggested change
_LOGGER.warning(f"Only one sample got for '{pv}'")
_LOGGER.warning(f"Only one sample was retrieved for '{pv}'")

Copilot uses AI. Check for mistakes.
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")
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
_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")

Copilot uses AI. Check for mistakes.
@zhangt58 zhangt58 merged commit 55c22cf into master Sep 19, 2025
9 checks passed
@zhangt58 zhangt58 deleted the log branch September 19, 2025 14:34
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.

1 participant