Skip to content

Commit

Permalink
log ERROR messages in qlogs too (commaai#23425)
Browse files Browse the repository at this point in the history
* log ERROR messages in qlogs too

* own event

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
  • Loading branch information
pd0wm and adeebshihadeh authored Jan 6, 2022
1 parent 1a6881e commit 4528075
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cereal
10 changes: 8 additions & 2 deletions selfdrive/logmessaged.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ def main() -> NoReturn:
sock.bind("ipc:///tmp/logmessage")

# and we publish them
pub_sock = messaging.pub_sock('logMessage')
log_message_sock = messaging.pub_sock('logMessage')
error_log_message_sock = messaging.pub_sock('errorLogMessage')

while True:
dat = b''.join(sock.recv_multipart())
Expand All @@ -29,7 +30,12 @@ def main() -> NoReturn:
# then we publish them
msg = messaging.new_message()
msg.logMessage = record
pub_sock.send(msg.to_bytes())
log_message_sock.send(msg.to_bytes())

if level >= 40: # logging.ERROR
msg = messaging.new_message()
msg.errorLogMessage = record
error_log_message_sock.send(msg.to_bytes())


if __name__ == "__main__":
Expand Down

0 comments on commit 4528075

Please sign in to comment.