Skip to content

Commit

Permalink
atgmlogger 0.6.1 log clear fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bradyzp committed Apr 6, 2022
1 parent 1a79926 commit 6e8cdf2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,15 @@ Dynamic Gravity Systems - Serial Data Recorder v0.6.0
```commandline
/usr/bin/python3 -m atgmlogger -vvv
```
---
Building the Release:
```shell
venv/scripts/activate
pip install -r requirements.txt
pip install wheel setuptools
python setup.py bdist_wheel
```
2 changes: 1 addition & 1 deletion atgmlogger/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

__all__ = ['LOG_LVLMAP', 'LOG_FMT', 'DATE_FMT', 'POSIX', '__version__', '__description__']

__version__ = '0.6.0'
__version__ = '0.6.1'
__description__ = "Advanced Technology Gravity Meter - Serial Data Logger"

LOG_LVLMAP = {0: logging.CRITICAL,
Expand Down
8 changes: 4 additions & 4 deletions atgmlogger/plugins/usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@ def watch_files(self, run=True):
@_filehook(r'clear(\.txt)?')
def clear_logs(self, match):
LOG.info("Clearing old application logs and gravity data files.")
for file in self.logdir.iterdir(): # type: Path
if file.is_file() and file.suffix in ['.gz']:
LOG.warning("Deleting archived file: %s", file.name)
for path in self.logdir.glob("*.dat.*"): # type: Path
if path.is_file():
LOG.warning("Deleting file: %s", path.name)
try:
os.remove(str(file.resolve()))
os.remove(str(path.resolve()))
except OSError:
LOG.exception("Error removing archived file.")

Expand Down

0 comments on commit 6e8cdf2

Please sign in to comment.