Skip to content

Commit

Permalink
Modified error logging to interface directory
Browse files Browse the repository at this point in the history
  • Loading branch information
connervieira committed Nov 4, 2023
1 parent f43dd45 commit 3a1cd6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,3 +366,5 @@ This update makes several changes to Predator that dramatically improve its proc
- Fixed a typo in a debug message inside `alpr_stream_maintainer()`.
- Improved debug message handling when multiple threads are running concurrently.
- Added a configuration value to disable the logging of all license plate guesses alongside the top guess.
- Fixed some broken references to configuration values.
- Both errors and warnings are now logged to the error log file in the interface directory, instead of just errors.
2 changes: 2 additions & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ def display_message(message, level=1):
if (level == 1): # Display the message as a plain message.
print(message)
elif (level == 2): # Display the message as a warning.
error_log[time.time()] = message # Add this message to the log file, using the current time as the key.
save_to_file(error_file_location, json.dumps(error_log), True) # Save the modified error log to the disk as JSON data.
print(style.yellow + "Warning: " + message + style.end)
elif (level == 3): # Display the message as an error.
error_log[time.time()] = message # Add this error message to the log file, using the current time as the key.
Expand Down

0 comments on commit 3a1cd6f

Please sign in to comment.