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

Bug when cycling logfiles #29

Closed
garrettseepersad opened this issue May 19, 2023 · 1 comment · Fixed by #30
Closed

Bug when cycling logfiles #29

garrettseepersad opened this issue May 19, 2023 · 1 comment · Fixed by #30
Assignees
Labels
bug Something isn't working

Comments

@garrettseepersad
Copy link

When cycling the logs, _logpath is overwritten and then creates a runtime error because the logpath had included the previous filename

Problem
self._logpath = os.path.join(self._logpath, f"gnssntripclient-{tim}.log")

Solution
self._logfilepath = os.path.join(self._logpath, f"gnssntripclient-{tim}.log")
with open(self._logfilepath , "a", encoding="UTF-8") as log:

@semuadmin semuadmin added the bug Something isn't working label May 23, 2023
@semuadmin
Copy link
Contributor

semuadmin commented May 23, 2023

Hi @garrettseepersad

Good shout, thanks. On it.

Exception in thread Thread-1 (_read_thread):
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/steve/Library/Python/3.11/lib/python/site-packages/pygnssutils/gnssntripclient.py", line 448, in _read_thread
    self._do_data(self._socket, stopevent, ggainterval, output)
  File "/Users/steve/Library/Python/3.11/lib/python/site-packages/pygnssutils/gnssntripclient.py", line 538, in _do_data
    self._do_write(output, raw_data, parsed_data)
  File "/Users/steve/Library/Python/3.11/lib/python/site-packages/pygnssutils/gnssntripclient.py", line 562, in _do_write
    self._do_log(parsed, VERBOSITY_MEDIUM)
  File "/Users/steve/Library/Python/3.11/lib/python/site-packages/pygnssutils/gnssntripclient.py", line 600, in _do_log
    with open(self._logpath, "a", encoding="UTF-8") as log:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
NotADirectoryError: [Errno 20] Not a directory: './gnssntripclient-20230523130251.log/gnssntripclient-20230523130256.log'

semuadmin added a commit that referenced this issue May 23, 2023
@semuadmin semuadmin mentioned this issue May 23, 2023
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants