Fixed GPS timestamp + new logging feature + more #82
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.
EDITS:
failfiles/
folder instead of thelogfiles/
folder because the location of parse fails has changed tofailfiles/
now. Done by changingLOG_DIRECTORY
toFAIL_DIRECTORY
as the file search location in theupload_logs
function.Purpose:
time.time()
to get the current epoch time and then this is rounded down to a whole day. It is onto this rounded down timestamp the GPS timestamp is added. This needed to be done because GPS only provides the hours, minutes, and seconds in GMT. See this Monday update for more details.Changes:
user/Aarjavjain101/log_dbg_fails
branch was fixed in which thedbgfiles
directory was not created when link telemetry was ran with the -u option for the first time. To fix this, the logic to perform log uploading was put after creating the necessary directories. Additionally, a small error in which the pretty printed parse fail message would go to thelogfiles
folder instead of thedbgfiles
folder was fixed by switching the directory arguments in thewrite_to_log_files
function.logMessage
field of JSON response. This field tells link_telemetry whether to log the pretty printed table + raw message or not.BeautifulTable
instead ofPrettyTable
because of a new change to the display data section. Essentially, there is now more flexibility in displaying data as either rows or columns. This is to accommodate theRaw Hex
field as Pretty Table could not support this. Also, there is much more customizability with beautiful table. Note that there is a warning being suppressed for using attributes which will be deprecated in the future (v1.2.0 of beautiful table but I updated requirements.txt to so that we use v1.1.0).write_to_log_file
function to be able to write the beautiful table into the log file (encoding issues previously due to latin-1).process_response
function to match newBeautifulTable
.dbgfiles
is the folder containing pretty printed parse fails response from a session. Thefailfiles
folder contains the raw hex messages which were failed from a session (just dbgfail but raw message this time). Instead of including these into one file/folder (why have two separate folder for parse fails) I separated them because it makes spotting patterns in message data a lot easier than scrolling through the verbose parse fail explanations. Lastly,logfiles
folder is filled with beautiful table messages that are printed to the terminal only if you specified those messages to be logged. The arguments for what can be logged work the same as for live stream filters (see README.md for more info).Next Steps:
get_current_timestamp
inside interrupt handler changes.