Skip to content

Commit

Permalink
Eliminate the need to use patched LogentriesHandler from PR
Browse files Browse the repository at this point in the history
that is outstanding since 2017.

LogentriesCommunity/le_python#61
  • Loading branch information
sobomax committed Dec 17, 2020
1 parent 39b7550 commit 20ffda4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion selfdrive/logmessaged.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def main():
if levelnum >= le_level:
# push to logentries
# TODO: push to athena instead
le_handler.emit_raw(dat)
le_handler.emit(dat)

# then we publish them
msg = messaging.new_message()
Expand Down
10 changes: 9 additions & 1 deletion selfdrive/swaglog.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,19 @@

from common.logging_extra import SwagLogger, SwagFormatter

class snostrip(str):
def rstrip(self, *args):
return self

class OPLogentriesHandler(LogentriesHandler):
def format(self, record):
r = LogentriesHandler.format(self, record)
return snostrip(r)

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)
return OPLogentriesHandler(le_token, use_tls=False, verbose=False)


class LogMessageHandler(logging.Handler):
Expand Down

0 comments on commit 20ffda4

Please sign in to comment.