Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FileHandler for logging to file, new argument for logging API JSON responses to file #59

Merged
merged 2 commits into from
Oct 20, 2024

Conversation

AustinCullar
Copy link
Owner

Two new arguments are added here:

  • --log-json | -j: log JSON responses from API to the log file only
  • --log-file: specify name/location of log file (./astro_log.txt by default)

Other changes:

  • Add contextmanager method to AstroLogger() to facilitate logging only to file
    • this is used to capture json responses, since these are very noisy
  • AstroLogger.print_object() has been replaced with print_video_data()
    • Trying to move away from rich tables, as these are not printed to log file
  • logging tests modified to account for log method changes

    - `--log-json`: log json to file, not console
    - `--log-file`: optional argument to specify location of log file
        - by default, this will be `astro_log.txt` in the current directory
- Add contextmanager method to AstroLogger() to facilitate logging only to file
    - this is used to capture json responses, since these are very noisy
- AstroLogger.print_object() has been replaced with print_video_data()
    - Trying to move away from rich tables, as these are not printed to log file
- logging tests modified to account for log method changes
@AustinCullar AustinCullar added the enhancement New feature or request label Oct 20, 2024
@AustinCullar AustinCullar self-assigned this Oct 20, 2024
@AustinCullar AustinCullar linked an issue Oct 20, 2024 that may be closed by this pull request
Copy link

Code Coverage

Package Line Rate Health
src 90%
src.data_collection 90%
src.tests 97%
Summary 93% (653 / 703)

Minimum allowed line rate is 70%

@AustinCullar AustinCullar merged commit 2197cd8 into main Oct 20, 2024
1 check passed
@AustinCullar AustinCullar deleted the 55-log-api-responses-for-comments branch October 20, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Log API responses for comments
1 participant