From aab2a58a2d97fb97f0459b476e389b649f4606c5 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Tue, 23 Mar 2021 13:48:44 +0000 Subject: [PATCH] Reduce some log spam: * Comment out the traceback in plugins/eddn.py, the return is enough. * 'Called with no event_queue' can be TRACE. * Don't care about "Everything was alright, the near-neutral status just wasn't stored." from Inara. --- monitor.py | 2 +- plugins/eddn.py | 8 ++++---- plugins/inara.py | 7 +++++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/monitor.py b/monitor.py index 55c9ebea..3fc0518a 100644 --- a/monitor.py +++ b/monitor.py @@ -845,7 +845,7 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below return None if not self.event_queue: - logger.debug('Called with no event_queue') + logger.trace('Called with no event_queue') return None else: diff --git a/plugins/eddn.py b/plugins/eddn.py index d3df32f8..be29284c 100644 --- a/plugins/eddn.py +++ b/plugins/eddn.py @@ -6,7 +6,6 @@ import pathlib import re import sys import tkinter as tk -import traceback from collections import OrderedDict from os import SEEK_SET from os.path import join @@ -187,9 +186,10 @@ Msg:\n{msg}''' # Paranoia check in case this function gets chain-called. if not self.replaylog: - logger.error( - f'self.replaylog (type: {type(self.replaylog)}) is falsey after update_idletasks(). Traceback:\n' - f'{"".join(traceback.format_list(traceback.extract_stack()))}') + # import traceback + # logger.error( + # f'self.replaylog (type: {type(self.replaylog)}) is falsey after update_idletasks(). Traceback:\n' + # f'{"".join(traceback.format_list(traceback.extract_stack()))}') return try: diff --git a/plugins/inara.py b/plugins/inara.py index ac5d53f5..47eaf6dd 100644 --- a/plugins/inara.py +++ b/plugins/inara.py @@ -1275,8 +1275,11 @@ def send_data(url: str, data: Mapping[str, Any]) -> bool: # Log individual errors and warnings for data_event, reply_event in zip(data['events'], reply['events']): if reply_event['eventStatus'] != 200: - logger.warning(f'Inara\t{status} {reply_event.get("eventStatusText", "")}') - logger.debug(f'JSON data:\n{json.dumps(data_event)}') + if ("Everything was alright, the near-neutral status just wasn't stored." + not in reply_event.get("eventStatusText")): + logger.warning(f'Inara\t{status} {reply_event.get("eventStatusText", "")}') + logger.debug(f'JSON data:\n{json.dumps(data_event)}') + if reply_event['eventStatus'] // 100 != 2: plug.show_error(_('Error: Inara {MSG}').format( MSG=f'{data_event["eventName"]},'