-
Notifications
You must be signed in to change notification settings - Fork 1
Logging improvements #113
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
Open
krowvin
wants to merge
27
commits into
main
Choose a base branch
from
logging-improvements
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Logging improvements #113
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
eb2bb29
Setup initial timeseries group structure from BLOB
krowvin 3885451
Add click options for retrieve
krowvin d091df2
Regenerate poetry.lock to fix isort checksum
krowvin d121559
Merge branch 'main' of https://github.com/HydrologicEngineeringCenter…
krowvin e7b6db4
Merge branch '77-time-series-group-crud' of https://github.com/Hydrol…
krowvin 0ad9fa5
Add logging click option
krowvin 92b0ef2
Add CLI options for retrieve
krowvin 5830697
Add retrieve command
krowvin 35bfc3b
add io utility for writing to disk
krowvin fc05059
Set default log level
krowvin 7235be9
Remove unused method, allow for stdin or file in
krowvin 3b5de09
Correct types
krowvin 519ad70
Ensure office is uppercase, resolve it in CDA with usace/cwms-data-ap…
krowvin 0e93ca5
Add and test ts group delete command
krowvin 4f093fa
Add smoke test for 3.9 (can't use pytest)
krowvin a0068b5
Wording on root ts group command
krowvin 7ebf815
First attempt at wrapping cli in an friendly error handler
krowvin c0341b1
Update black code check version and run formatter for all files
krowvin ff249de
Merge branch 'main' of https://github.com/HydrologicEngineeringCenter…
krowvin c89d4b5
Update black dependency version and change code check to use the same…
krowvin 12aa8cc
Disable venv for poetry in CI/CD
krowvin 9d4b7a5
Merge branch 'main' of https://github.com/HydrologicEngineeringCenter…
krowvin d254ad6
Ensure -h flag is available as well as --help
krowvin 793b945
Update poetry lock to latest
krowvin 3cb7611
Merge branch '101-handle-missing-system-certs-error' of https://githu…
krowvin 0fd873a
Merge branch 'main' of https://github.com/HydrologicEngineeringCenter…
krowvin cb3d957
Remove TS Group command
krowvin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import logging | ||
| import os | ||
| from pathlib import Path | ||
|
|
||
|
|
||
| def write_to_file(file_path: str, data: str, create_dir: bool = False) -> None: | ||
| """Writes data to a file at the specified path.""" | ||
| if not file_path: | ||
| raise ValueError("You must specify a file path to write data to.") | ||
| if not data: | ||
| raise ValueError("No data provided to write to file.") | ||
| if create_dir: | ||
| Path(os.path.dirname(file_path)).mkdir(parents=True, exist_ok=True) | ||
| with open(file_path, "w") as file: | ||
| file.write(data) | ||
| logging.info(f"Data written to file: {file_path}") |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I keep typing
-hinstead of--help👍