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

Fails are now logged #80

Merged
merged 3 commits into from
May 11, 2024
Merged

Conversation

AarjavJain101
Copy link
Contributor

Purpose of Change:

  • Allows quick viewing of what parse fails occurred in there verbose format for better understanding. Although the parse fail is printed when link_telemetry is running, if there is a flurry of messages finding the parse fails is bother some. Instead catting the session of parse fails is much easier. Session meaning each time link_telemetry is ran. For example, when running a full integration CAN test and parse fails occurred because of a missing message in the DBC, scrolling through terminal is not ideal. Instead, typing cat dbgfiles/<NAME_OF_LATEST_FILE> is much more efficient to see what actually went wrong in its verbose format.

Changes:

  • Added another call to write_to_log_file after the calls to log the raw message during a PARSE FAIL or a INFLUX WRITE FAIL that logs the exact colorful debug message you see in the terminal
  • Changed logging function option to convert message to hex numbers or not (to preserve original colorful parse fail debug message)
  • Added appropriate global variables for the DEBUG_DIRECTORY and the DEBUG_FILE_NAME. This code mimicked the existing one for the LOG_DIRECTORY and LOG_FILE_NAME.

Testing:

  • Tested with setting a non-existent CAN ID in the can message randomizer function and ran with the randomizer to force parse fails. Then I confirmed by catting the log file in the dbgfiles folder and received the pretty printed debug message.

Copy link
Contributor

@mjohal67 mjohal67 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

@AarjavJain101 AarjavJain101 merged commit 3071369 into main May 11, 2024
1 check passed
@AarjavJain101 AarjavJain101 deleted the user/Aarjavjain101/log_dbg_fails branch May 19, 2024 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants