From 60f6e12debe7ed5f53076f3f1ab43fbd150d7087 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Mon, 13 Apr 2020 15:18:10 -0700 Subject: [PATCH] Can't import from logmessaged if build fails --- selfdrive/logmessaged.py | 8 +------- selfdrive/swaglog.py | 7 +++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/selfdrive/logmessaged.py b/selfdrive/logmessaged.py index 56e13e8028..91dcbb7e04 100755 --- a/selfdrive/logmessaged.py +++ b/selfdrive/logmessaged.py @@ -1,13 +1,7 @@ #!/usr/bin/env python3 import zmq -from logentries import LogentriesHandler import cereal.messaging as messaging - - -def get_le_handler(): - # setup logentries. we forward log messages to it - le_token = "e8549616-0798-4d7e-a2ca-2513ae81fa17" - return LogentriesHandler(le_token, use_tls=False, verbose=False) +from selfdrive.swaglog import get_le_handler def main(): diff --git a/selfdrive/swaglog.py b/selfdrive/swaglog.py index ef94fb91dc..005f6b701b 100644 --- a/selfdrive/swaglog.py +++ b/selfdrive/swaglog.py @@ -1,11 +1,18 @@ import os import logging +from logentries import LogentriesHandler import zmq from common.logging_extra import SwagLogger, SwagFormatter +def get_le_handler(): + # setup logentries. we forward log messages to it + le_token = "e8549616-0798-4d7e-a2ca-2513ae81fa17" + return LogentriesHandler(le_token, use_tls=False, verbose=False) + + class LogMessageHandler(logging.Handler): def __init__(self, formatter): logging.Handler.__init__(self)