Can't import from logmessaged if build fails

This commit is contained in:
Willem Melching 2020-04-13 15:18:10 -07:00
parent dd05d1df83
commit 60f6e12deb
2 changed files with 8 additions and 7 deletions

View File

@ -1,13 +1,7 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import zmq import zmq
from logentries import LogentriesHandler
import cereal.messaging as messaging import cereal.messaging as messaging
from selfdrive.swaglog import get_le_handler
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)
def main(): def main():

View File

@ -1,11 +1,18 @@
import os import os
import logging import logging
from logentries import LogentriesHandler
import zmq import zmq
from common.logging_extra import SwagLogger, SwagFormatter 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): class LogMessageHandler(logging.Handler):
def __init__(self, formatter): def __init__(self, formatter):
logging.Handler.__init__(self) logging.Handler.__init__(self)